【发布时间】:2017-12-22 00:40:55
【问题描述】:
我已将当前分支 dev 设置为使用以下 git push --set-upstream origin dev:test 推送到 refs/remotes/test。
.git/config 看起来像:
[remote "origin"]
url = https://appulocal@bitbucket.org/appulocal/test_st.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "dev"]
remote = origin
merge = refs/heads/test
但是当我执行git push 时,它不会从本地dev 推送到远程test。
Git bash 显示消息:
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:test
To push to the branch of the same name on the remote, use
git push origin dev
To choose either option permanently, see push.default in 'git help config'.
如何解决这个问题,以便仅在执行git push 我当前的分支dev 时推送到远程test?
【问题讨论】:
-
To choose either option permanently, see push.default in 'git help config'.
标签: git git-remote