总结:git 不常用命令
1
2
# 远程分支与本地分支有不相关的提交,合并远程分支
git pull origin main --allow-unrelated-histories
1
2
# 删除远程分之
git push origin --delete <branch_name>
1
2
# 更新远程分支列表
git remote update origin --prune
1
2
3
4
5
6
7
8
9
10
# 删除submodule
# Remove the submodule entry from .git/config
git submodule deinit -f .\3rd\xz-v5.8.1\
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/3rd/xz-v5.8.1
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f 3rd/xz-v5.8.1
本文由作者按照 CC BY 4.0 进行授权