Re: git push on tracking branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 27, 2010 at 12:00:41PM -0400, Stephen Bash wrote:

> A coworker alerted me to some strange behavior with git push on tracking branches (maybe a documentation error?).  Pro Git (http://progit.org/book/ch3-5.html) says:
> 
> "To set up a local branch with a different name than the remote branch, you can easily use the first version with a different local branch name:
>    $ git checkout -b sf origin/serverfix
>    Branch sf set up to track remote branch refs/remotes/origin/serverfix.
>    Switched to a new branch "sf"
> Now, your local branch sf will automatically push to and pull from origin/serverfix."

That has never been the case by default. Push has always defaulted to
pushing all matching branches (so of course if you use the same name, it
will end up pushing to the tracking branch).  However, you can do:

  git config --global push.default tracking

to explicitly change the default to push the current branch to its
upstream. See the entry for "push.default" in "git help config".

It may be that Pro Git suggested setting up that config earlier. If not,
you should probably submit a bug report for the book.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]