master #1

Merged
olivier merged 22 commits from vincent/notebook:master into master 2021-04-13 13:15:00 +00:00
3 changed files with 39 additions and 0 deletions
Showing only changes of commit 25b4b80a4d - Show all commits

View File

@ -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

35
IT/git/submodule.md Normal file
View File

@ -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

BIN
IT/img/git.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB