git push vs git push origin< branchname> [英] git push vs git push origin <branchname>

查看:99
本文介绍了git push vs git push origin< branchname>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对git很陌生。我正在创建一个分支,然后想将它推到原点。我认为,站在我的分支上的简单发布git push应该足够了。是否有可能做到这一点(通过指定push.default简单)?这样做是否合理?

  git push -u origin branchname 

请确保:



默认策略,只推送当前分支,并且只有当该分支具有相同名称的上游分支时。

避免推送所有匹配分支(之前的默认策略),其中即使他们还没有准备好可以看到,大量的测试分支也被推送上游回购


I'm quite new to git. I'm creating a branch and then want to push it to origin. I think that simple issuing git push while standing on my branch should be sufficient. Is it possible to do that (by specifying push.default simple)? Is it reasonable to do that?

解决方案

The first push should be a:

git push -u origin branchname

That would make sure:

Any future git push will, with that default policy, only push the current branch, and only if that branch has an upstream branch with the same name.
that avoid pushing all matching branches (previous default policy), where tons of test branches were pushed even though they aren't ready to be visible on the upstream repo.

这篇关于git push vs git push origin< branchname>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆