简体   繁体   English

git push 到对应的分支,无需写分支名称

[英]Git push to corresponding branch without having to write the branch name

I cloned a git repo and do my local changes.我克隆了一个 git repo 并进行了本地更改。 I add and commit and now I want to push to the remote repo.我添加并提交,现在我想推送到远程仓库。 Currently I use:目前我使用:

git push origin [branch]

But I remember to have been told, that git push can be enough.但我记得有人告诉我, git push就足够了。 Still I cannot figure out how to do that.我仍然无法弄清楚如何做到这一点。

Any help is greatly appreciated!任何帮助是极大的赞赏!

Please refer to this solution: Default behavior of "git push" without a branch specified请参考这个解决方案: 没有指定分支的“git push”的默认行为

The accepted answer gives a clear overview.接受的答案给出了清晰的概述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git将新的本地分支推送到远程,而无需指定名称 - Git push new local branch to remote, without having to specify name 没有合并的git push分支 - git push branch without merge 推送git commit没有分支 - Push git commit without a branch 在该分支上查找 git 没有分支名称/标签且提交 hash 的“分支” - Find git “branch” with no branch name/label having a commit hash on that branch 从 git repo 的特定远程分支上的旧提交中删除一些文件(无需推送到主分支) - Remove a number of files from old commits on specific remote branch of git repo (without having to push to master branch) 可以执行“ git push origin”而不是“ git push origin” <branch> ”,而不必一次为每个分支做准备 - Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it 在 Git 中,在不跟踪相应远程的情况下推送本地分支实际上是什么意思? - In Git, what does it actually mean to push a local branch without tracking the corresponding remote? 水银分支和合并,而无需推送分支 - Mercurial branching and merging without having to push branch 为 git push -u 指定了错误的分支名称 - Specified wrong branch name for git push -u git将分支推送到具有不同名称的新仓库 - git push branch to a new repo with a different name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM