forked from vincent/notebook
git modification
This commit is contained in:
parent
6506eb1ce0
commit
25b4b80a4d
@ -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
35
IT/git/submodule.md
Normal 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
BIN
IT/img/git.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
Reference in New Issue
Block a user