常用操作
切换到远程分支
git branch -av
git checkout -b remotes/origin/master
切换到本地不存在的远程分支
vi .git/config
# 在[remote "origin"]添加
fetch = +refs/heads/v2:refs/remotes/origin/v2
[branch "v2"]
remote = origin
merge = refs/heads/v2
git pull origin v2:v2
git checkout v2
git branch -avv
浅克隆一个远程分支
https://blog.ghostry.cn/technique/895.html
回滚代码
git reset --hard commitid
撤销某次提交
git revert commitid
文档更新时间: 2019-08-21 06:28 作者:ghostry