您的位置:首页 > 其它

git切换分支后不用显示指示push到分支的小技巧

2015-07-31 20:11 477 查看
在上一篇文章中,我们讲到了push到远程非master分支的时候,需要显示指示,不过不这样做,就会自动创建和本地分支一样的新分支。那么如果我们的本地分支的名字和远程分支是一样的,是不是就不需要显示指定了呢?

试验

58deMacBook-Pro:ResponseTimeTool wuxian$ git add .
58deMacBook-Pro:ResponseTimeTool wuxian$ git status
On branch developer
Your branch is up-to-date with 'origin/developer'.

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified:   build.gradle

58deMacBook-Pro:ResponseTimeTool wuxian$ git commit -m "udpate"
[developer 5d3350c] udpate
1 file changed, 1 deletion(-)
58deMacBook-Pro:ResponseTimeTool wuxian$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 273 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To

96978fb..5d3350c  developer -> developer
58deMacBook-Pro:ResponseTimeTool wuxian$


实验证明是正确的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: