* git push in --tracked branches.
@ 2010-04-22 0:02 Aghiles
2010-04-22 0:44 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Aghiles @ 2010-04-22 0:02 UTC (permalink / raw)
To: git list
So I created a branch that tracks 'origin' which is remote:
git checkout -b small_fixes origin
I can do a 'git pull' and everything works as expected. I did some
commits in this branch and I issue a 'git push'. To my surprise
the 'git push' is still operating on the master and not the current
'small_fixes' branch! What is the rationale behind this ? I would
expect to push from my current branch to origin (especially that
I am --tracking origin).
-- aghiles
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git push in --tracked branches.
2010-04-22 0:02 git push in --tracked branches Aghiles
@ 2010-04-22 0:44 ` Jeff King
2010-04-22 1:13 ` Aghiles
0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2010-04-22 0:44 UTC (permalink / raw)
To: Aghiles; +Cc: git list
On Wed, Apr 21, 2010 at 08:02:49PM -0400, Aghiles wrote:
> So I created a branch that tracks 'origin' which is remote:
>
> git checkout -b small_fixes origin
>
> I can do a 'git pull' and everything works as expected. I did some
> commits in this branch and I issue a 'git push'. To my surprise
> the 'git push' is still operating on the master and not the current
> 'small_fixes' branch! What is the rationale behind this ? I would
> expect to push from my current branch to origin (especially that
> I am --tracking origin).
"git push" will by default push matching refs. This has been the
behavior since day one. See the description of push.default in "git help
config" for other options (I think you want "tracking").
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git push in --tracked branches.
2010-04-22 0:44 ` Jeff King
@ 2010-04-22 1:13 ` Aghiles
2010-04-22 1:52 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Aghiles @ 2010-04-22 1:13 UTC (permalink / raw)
To: Jeff King; +Cc: git list
On Wed, Apr 21, 2010, Jeff King <peff@peff.net> wrote:
> "git push" will by default push matching refs. This has been the
> behavior since day one. See the description of push.default in "git help
> config" for other options (I think you want "tracking").
Thank you very much. The 'tracking' case is what I need. Could you
enlighten me why pushing all matching branches is a sensible default ?
It seems like an unusual thing to do.
-- aghiles
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git push in --tracked branches.
2010-04-22 1:13 ` Aghiles
@ 2010-04-22 1:52 ` Jeff King
2010-04-22 19:52 ` Aghiles
0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2010-04-22 1:52 UTC (permalink / raw)
To: Aghiles; +Cc: git list
On Wed, Apr 21, 2010 at 09:13:14PM -0400, Aghiles wrote:
> On Wed, Apr 21, 2010, Jeff King <peff@peff.net> wrote:
>
> > "git push" will by default push matching refs. This has been the
> > behavior since day one. See the description of push.default in "git help
> > config" for other options (I think you want "tracking").
>
> Thank you very much. The 'tracking' case is what I need. Could you
> enlighten me why pushing all matching branches is a sensible default ?
> It seems like an unusual thing to do.
I think it comes from a workflow where you tend to have a private repo
and then a personal public repo for publishing. The matching refs are
then the set of refs that you have previously pushed. So you do:
$ git push public foo ;# publish "foo" for the first time
$ git push public ;# now "foo" will be published every time
And you probably do work on topic branches, and only merge them into
your public branches when they are ready to show the world. So push is
really about synchronizing those public branches.
If you are working by cloning from a collaborative central repository,
then that workflow doesn't make as much sense. The refs on the other end
are not about "things I have published before" but rather "the set of
all refs that our group agrees about". And probably your workflow is to
hack on a specific ref, and then push changes to that ref.
Git grew out of the first type of workflow, and that has always been the
default. Tools for helping the latter workflow have developed later.
There was some discussion about changing the default, but it hurts
people used to the current default, so we ended up with the config
variable.
That is just my two cents, though. I have largely stayed out of the
debates which seem to come up every once in a while. I think this thread
is the one that lead to push.default:
http://article.gmane.org/gmane.comp.version-control.git/111375
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git push in --tracked branches.
2010-04-22 1:52 ` Jeff King
@ 2010-04-22 19:52 ` Aghiles
0 siblings, 0 replies; 5+ messages in thread
From: Aghiles @ 2010-04-22 19:52 UTC (permalink / raw)
To: Jeff King; +Cc: git list
Hello Jeff,
> Git grew out of the first type of workflow, and that has always been the
> default. Tools for helping the latter workflow have developed later.
> There was some discussion about changing the default, but it hurts
> people used to the current default, so we ended up with the config
> variable.
Thank you for the explanation. For what it's worth (probably 0) I vote
for the default to be 'tracking'.
-- aghiles
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-22 19:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22 0:02 git push in --tracked branches Aghiles
2010-04-22 0:44 ` Jeff King
2010-04-22 1:13 ` Aghiles
2010-04-22 1:52 ` Jeff King
2010-04-22 19:52 ` Aghiles
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).