How to setup current branch (dev) to push to refs/remotes/test with git push only?

Viewed 160

I have setup my current branch dev to push to refs/remotes/test with the following git push --set-upstream origin dev:test.

.git/config looks like:

[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

but when I do git push it does not push from local dev to test on remote. Git bash shows the message:

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'.

How to resolve this so that only on doing git push my current branch dev pushes to test on remote?

1 Answers
Related