git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git [2013/07/01 20:02] – [Setting up GIT] k2patel | git [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 110: | Line 110: | ||
| done | done | ||
| </ | </ | ||
| + | |||
| + | ==== Git reset local ==== | ||
| + | **following command can be used for following purpose :** \\ | ||
| + | To discard all local changes and restore it to the remote repository.\\ | ||
| + | When you have error //Your branch is ahead of ' | ||
| + | <code bash> | ||
| + | git reset --hard origin/ | ||
| + | git pull | ||
| + | </ | ||
| + | |||
| + | ===== Git Submodule ===== | ||
| + | |||
| + | ==== Clone Repository including submodule ==== | ||
| + | |||
| + | <code bash> | ||
| + | git clone --recursive git@github.com: | ||
| + | </ | ||
| + | |||
| + | ==== clone submodule from existing project ==== | ||
| + | |||
| + | <code bash> | ||
| + | git submodule update --init --recursive | ||
| + | </ | ||
| + | |||
| + | ==== To initialize single submodule ==== | ||
| + | <code bash> | ||
| + | git submodule update --init modules/ | ||
| + | </ | ||
| + | |||
| + | ==== Pull changes from all submodule ==== | ||
| + | <code bash> | ||
| + | git submodule foreach git pull origin master | ||
| + | </ | ||
| + | |||
| + | ==== Usefull when submodule HEAD and status HEAD messed up ==== | ||
| + | <code bash> | ||
| + | git submodule update --init | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
git.1372708937.txt.gz · Last modified: 2020/08/10 02:30 (external edit)
