Android知识Android技术知识Git使用

Git -- 提交本地分支到远端分支/拉取远程分支

2017-03-31  本文已影响933人  GYLEE

git branch newbranch

git checkout -b newbranch 创建并切换到新分支

git branch

git checkout newbranch

git push origin newbranch:originbranch

git push origin :originbranch

git fetch origin 远程分支名x:本地分支名x
(个人使用经历:此语句会自动创建分支,但是必须指定本地分支名,否则则拉取分支失败 git branch --set-upstream-to=origin/XXX XXX 建立分支之间的跟踪关系 )

git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

上一篇下一篇

猜你喜欢

热点阅读