目录
git 最常用的命令
- git checkout [dev]
- git add .
- git commit -m "fix bug"
- git push origin [local]:[remote] -f
- git fetch
- git pull origin [remote]:[local]
- git rebase origin/dev
git 子模块相关
1.其他
- git clone <父模块url>
- git submodule init
- git submodule update
- git submodule add -b dev <子模块url>
- git submodule foreach git checkout origin/dev
2.删除子模块
- .gitmodules文件中删除相关的子模块信息 and stage
- .git/config中删除相关的子模块信息
git rm --cached [submodule
]
- rm -rf .git/modules/[
submodule
]- rm -rf [
submodule
]
git rebase
- git config –global core.editor vim
- git rebase -i HEAD~3
- git commit --amend
- 修改对应的提交,fixup---对应的是合并提交;
- git push origin <you_branch_name> -f
- git rebase --onto head commit1:commit