diff --git a/IT/git/Git.md b/IT/git/Git.md index f004850..2ede974 100644 --- a/IT/git/Git.md +++ b/IT/git/Git.md @@ -1,4 +1,8 @@ # git +![git](../img/git.jpg) +## Clone with submodule recurse + +add *--recurse-submodules* to clone command ## Add in staging only a part of modification done in a file diff --git a/IT/git/submodule.md b/IT/git/submodule.md new file mode 100644 index 0000000..79a2f5e --- /dev/null +++ b/IT/git/submodule.md @@ -0,0 +1,35 @@ +# submodule + +Git submodule allows ro add externel repository in a repository + +## Adding submodule + +- ```git submodule add http://git/toto.git $path``` + this command add *http://git/toto.git* in *path* directory (add -b $branchname to follow specific branch) +- after that you need to add and commit submodule folder + +to populate a submodule nested in other submodule + +- ```git submodule init``` +- ```git submodule update``` + +## removing submodule + +- remove submodule entry in *.gitmodules* +- remove submodule entry in *.git/config* (only present when **git submodule init** have been perform) +- remove submodule path ```git rm --cached $path``` + +## Updating submodule + + +you can update a submodule Manually going in submodule folder and perform a ```git fetch``` and ```git merge``` + + +### Fetch and merge +automatic process +- perform a ```git submodule update --remote``` + + +in each case you need to commit update in project + + diff --git a/IT/img/git.jpg b/IT/img/git.jpg new file mode 100644 index 0000000..1c1f762 Binary files /dev/null and b/IT/img/git.jpg differ