Suppose I have a tracking branch named 'abc
' which tracks origin/master
.
When I'm on 'abc
' and do a git push
, it pushes 'abc
' to 'abc
'.
How do I specify the remote push branch for it with just a 'git push
'?
Suppose I have a tracking branch named 'abc
' which tracks origin/master
.
When I'm on 'abc
' and do a git push
, it pushes 'abc
' to 'abc
'.
How do I specify the remote push branch for it with just a 'git push
'?
git branch --set-upstream-to abc origin/master
should be able to specify the remote branch.
Note the -to
added to --set-upstream
since git1.8.0.
Since Git1.7.0:
"
git branch --set-upstream
" can be used to update the (surprise!) upstream, i.e. where the branch is supposed topull
andmerge
from (orrebase onto
).
.git/config
and put in the branch and remote you want (you should have your master branch as an example to copy from, if needed, since it's set up automatically when you clone). –
Gaius git push origin abc
otherwise you are using ':' which a special refspec used only for matching branch names. –
Clot "git push" without a remote branch explicitly named will attempt to push to the site named "origin"
© 2022 - 2024 — McMap. All rights reserved.