-
Undo a local commit
git reset HEAD~ -
Add submodule rock to my project
git submodule add https://github.com/<user>/rock rockNote that in old version of git, you need to down the contents of rock
git submodule update --init --recursive -
Clone the project with submodule
git clone --recursive <project url>Or
git clone <project url>thengit submodule update --init --recursive -
Remove a submodule
- git submodule deinit -f -- a/submodule
- rm -rf .git/modules/a/submodule
- git rm -f a/submodule
- git rm --cached a/submodule 3bis mv a/submodule_tmp a/submodule
git push --delete origin <tagname>
If you also need to delete the local tag, use:
git tag --delete <tagname>
- git remote add upstream https://github.com/otheruser/repo.git
- git fetch upstream
- git checkout master
- git merge upstream/master
- git push