gpt4 book ai didi

git - 如何在不设置上游的情况下将当前分支推送到远程?

转载 作者:行者123 更新时间:2023-12-03 22:16:19 26 4
gpt4 key购买 nike

我可以将分支推送到远程:

git push --set-upstream origin 293-error-pages

通过明确指定当前分支,我可以在不设置上游的情况下推送分支:
git push origin 293-error-pages

如何将当前分支推送到远程? (并且没有明确指定其名称)
git push origin

告诉我:
fatal: The current branch 293-error-pages has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin 293-error-pages

最佳答案

要将当前分支推送到远程,您应该设置/配置 push.default到“当前”

git config --global push.default current

push.default
Defines the action git push should take if no refspec is explicitly given.current - push the current branch to update a branch with the same name on thereceiving end. Works in both central and non-central workflows.

关于git - 如何在不设置上游的情况下将当前分支推送到远程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50462500/

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