git push default behaviour?

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

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)

Re: git push default behaviour?

From: Sebastien Douche <hidden>
Date: 2016-06-15 22:53:19

On Thu, Mar 8, 2012 at 11:01, Jeremy Morton [off-list ref] wrote:
Hi everyone,
Hi Jeremy (sorry to be late, back from holiday)
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
I made many Git presentation and managed a lot of training[1] and the
first thing I explain on the configuration is :

1. set your name and email
2. change the default push option[2]

Moreover, most people I see don't understand the default behaviour:
it's a frequently ask question by beginner.


[1] For git French : http://gitfr.net/blog
[2] I recommend tracking


-- 
Sebastien Douche [off-list ref]
Twitter: @sdouche / G+: +sdouche

Re: git push default behaviour?

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

On Sat, Mar 17, 2012 at 9:36 AM, Sebastien Douche [off-list ref] wrote:
On Thu, Mar 8, 2012 at 11:01, Jeremy Morton [off-list ref] wrote:
quoted
Hi everyone,
Hi Jeremy (sorry to be late, back from holiday)
quoted
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
I made many Git presentation and managed a lot of training[1] and the
first thing I explain on the configuration is :

1. set your name and email
2. change the default push option[2]
So, that would seem to be a rather strong indication that the default
push option is a bad one.  :-)

Best regards,
Jeremy Morton (Jez)

Re: git push default behaviour?

From: Sebastien Douche <hidden>
Date: 2016-06-15 22:53:19

On Sat, Mar 17, 2012 at 10:38, Jeremy Morton [off-list ref] wrote:
quoted
I made many Git presentation and managed a lot of training[1] and the
first thing I explain on the configuration is :

1. set your name and email
2. change the default push option[2]
So, that would seem to be a rather strong indication that the default
push option is a bad one.  :-)
True. Never understood why matching is the default value :). Btw,
thank you for the discussion, I forgot to do that :(.

-- 
Sebastien Douche [off-list ref]
Twitter: @sdouche / G+: +sdouche

Re: git push default behaviour?

From: Pavel Pospíšil <hidden>
Date: 2016-06-15 22:53:20

Hi,
I consider myself a little bit experienced git newbie. I use git 1.7.5.4
I use git for 9 month in this way:
1. copy a released version from a centralized versioning control
system (this VCS does not have any git interface) to my local git repo
2. do work in git in my-branch
3. copy current work-in-progress reconfiguration from VCS to git
4. rebase my-branch onto current work-in-progress
5. copy my work to VCS
Therefore, no usage of push/pull.

I created my first public repo in which I share the released versions
of 4 development streams in 4 independent branches with my colleagues.
My usual workflow is:
1. copy a released version from VCS to my local git repo
2. git add .
3. git commit
4. git tag <release-name>
5. git push <my-public-repo> HEAD
6. git push <release-name>
I expected that push is meant (even after reading man git-push) to be
used in this way:
1. do some work in my-branch
2. merge it to master
3. git push
and this will push only the changes in the master branch I am
currently switched on.

Now, I realized that git push default is not "upstream" (the behaviour
I expected) but is "matching" that brings more automation (I assume
git community wants to achieve as much automation as possible).

I agree with Sebastien that current git push.default is too much
automation for newbies that "upstream" would be a better default for
newbies.

I came across an inconvenience in man git-push. There is no
Configuration section that will inform about the push.default
configuration parameter and educate the reading about various push
behaviours. I know that there is man git-config but it's too long and
it's too tedious to read all git configuration options.

Maybe, adding the Configuration section to man git-push will help.

Best regards,
Pavel Pospisil


On Sat, Mar 17, 2012 at 10:51 AM, Sebastien Douche [off-list ref] wrote:
On Sat, Mar 17, 2012 at 10:38, Jeremy Morton [off-list ref] wrote:
quoted
quoted
I made many Git presentation and managed a lot of training[1] and the
first thing I explain on the configuration is :

1. set your name and email
2. change the default push option[2]
So, that would seem to be a rather strong indication that the default
push option is a bad one.  :-)
True. Never understood why matching is the default value :). Btw,
thank you for the discussion, I forgot to do that :(.

--
Sebastien Douche [off-list ref]
Twitter: @sdouche / G+: +sdouche
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help