Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

git push default behaviour?

From: Jeremy Morton <hidden>
Date: 2016-06-15 22:53:15

Hi everyone,

I've noticed that the default behaviour of 'git push' is to push to
*all* branches that have a remote branch set up.  In order to push
just to one branch, you must specify 'git push repo branchname'.

This seems rather unintuative to me, and in the case of a '--force',
almost certainly not what you want.  You're usually working on one
branch and just want to push that one, and it's usually the branch
you're currently on. And in the case of a '--force', in addition by
pushing all branches to remote, you are going to undo any changes on
other branches made since you updated them on your local repo.

Wouldn't it be better for git's default push behaviour (at least with
the '--force' option) to be just to push to the current branch in the
current repo?  To push to all branches you could have an
'--allbranches' option.

Best regards,
Jeremy Morton (Jez)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help