gpt4 book ai didi

git push --all 已经在远程的分支,但不是未发布的本地分支

转载 作者:太空狗 更新时间:2023-10-29 14:38:33 25 4
gpt4 key购买 nike

git push --all 对于将大量 merge 链推送到远程非常方便,但它有推送分支的副作用,您可能还不想推送这些分支,因此应该在那种情况下应该避免。

但我真的很喜欢--all

有没有办法让 push 推送已经在该远程上的所有分支,但不推送远程没有的分支?

最佳答案

尝试 git push origin : 因为它应该只在远程端推送匹配的分支。

参见:https://www.kernel.org/pub/software/scm/git/docs/git-push.html#OPTIONS

The special refspec : (or +: to allow non-fast-forward updates) directs git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side. This is the default operation mode if no explicit refspec is found (that is neither on the command line nor in any Push line of the corresponding remotes file---see below) and no push.default configuration variable is set.

关于git push --all 已经在远程的分支,但不是未发布的本地分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24044604/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com