常用Git命令

2021-02-24  本文已影响0人  军如令

git branch -vv:查看本地分支以及对应的远程分支

git checkout xxx:切换到xxx分支

git fetch:与服务器端同步分支信息

git checkout -b xxx -t origin/xxx:切换或者创建本地分支并且连接到对应的远程分支

git branch -D xxx:删除xxx分支

git reset --soft HEAD~1:回退最新一次的commit到add状态(一般可以用于pull代码冲突后,先reset --hard回退代码,在reset --soft回退commit,再git pull拉取代码,再commit,再push,就不会冲突了)

git push origin HEAD:refs/for/xxx:有refs/for会先推送到gerrit服务器,审核代码

git config --system --unset credential.helper:当拉取代码输错密码时,可用这个重置

上一篇 下一篇

猜你喜欢

热点阅读