From 45a4c29c8f323a613c523d3b9d04250f8918c914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20SALVI?= Date: Thu, 4 Jan 2024 23:11:22 +0100 Subject: [PATCH] "Update git sheetcheat for git submodules" --- sheatsheet/git.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sheatsheet/git.rst b/sheatsheet/git.rst index 99f2ec5..1e16498 100644 --- a/sheatsheet/git.rst +++ b/sheatsheet/git.rst @@ -22,6 +22,15 @@ Clonage ``git clone `` +Ou, métode que je préfère pour plus de clareté avec ``git log``, on merge dans un git init neuf + +``mkdir /path/to/project`` +``cd /path/to/project`` +``git init`` +``git remote add origin ssh://user@git-server/path/to/myrepo.git`` +``git pull`` +``git merge origin/master`` + Pousser un dépot local sur un dépot distant qui vient d'être initalisé ``git remote add origin ssh://user@git-server/path/to/myrepo.git`` @@ -120,3 +129,26 @@ aussi souvent que nmécessaire ``git rebase -i origin/master`` ``git push`` + +Git Submodules +-------------- + +Ajouter un submodule + +``git submodule add ssh://user@server/path/to/submodule.git submodule/path`` +``cd submodule/path`` +``rm -fr .* *`` +``git init`` +``git remote add origin ssh://beastie@ssh.debian-server/path/to/submodule.git`` +``git merge origin/master`` +``git commit -a`` +``git push`` + +Modifier un submodule + +``cd path/to/submodule`` +``git commit -a`` +``git push`` +``cd path/to/project`` +``git commit -a`` +``git push``