Re: Using the --track option when creating a branch

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bill Lear <rael@...>
Cc: <git@...>
Date: Wednesday, October 29, 2008 - 12:25 pm

On Wed, Oct 29, 2008 at 4:23 PM, Bill Lear <rael@zopyra.com> wrote:

branch.autosetupmerge controls if --track is used by default (it is
true by default since a long time)
(See "git help config" for details)


It should just work (at least in the lastest releases) when creating a
branch from a remote branch.

$ git checkout -b X origin/X
or
$ git branch X origin/X
Branch X set up to track remote branch refs/remotes/origin/X


It it just two configs (apart from the remote repository). A help
message should appear when using "git pull" without arguments and it
cannot figure out the branch to merge:

$ # currently in branch next
$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.next.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.next.remote = <nickname>
    branch.next.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

See git-config(1) for details.

[end]

so to add it after the fact you should execute:

$ git config branch.next.remote origin
$ git config branch.next.merge refs/heads/next


See above.


Santi
--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Using the --track option when creating a branch, Bill Lear, (Wed Oct 29, 11:23 am)
Re: Using the --track option when creating a branch, Sam Vilain, (Thu Oct 30, 1:12 am)
Re: Using the --track option when creating a branch, Bill Lear, (Thu Oct 30, 8:04 am)
Re: Using the --track option when creating a branch, Santi Béjar, (Thu Oct 30, 8:41 am)
Re: Using the --track option when creating a branch, Bill Lear, (Thu Oct 30, 8:12 am)
Re: Using the --track option when creating a branch, Andreas Ericsson, (Thu Oct 30, 8:25 am)
Re: Using the --track option when creating a branch, Sam Vilain, (Thu Oct 30, 12:44 pm)
Re: Using the --track option when creating a branch, Samuel Tardieu, (Thu Oct 30, 9:52 am)
Re: Using the --track option when creating a branch, Jeff King, (Sun Nov 2, 12:23 am)
Re: Using the --track option when creating a branch, Andreas Ericsson, (Thu Oct 30, 10:06 am)
Re: Using the --track option when creating a branch, Samuel Tardieu, (Thu Oct 30, 10:23 am)
Re: Using the --track option when creating a branch, Andreas Ericsson, (Thu Oct 30, 10:54 am)
Re: Using the --track option when creating a branch, Sam Vilain, (Thu Oct 30, 1:57 pm)
Re: Using the --track option when creating a branch, Samuel Tardieu, (Thu Oct 30, 11:04 am)
Re: Using the --track option when creating a branch, Andreas Ericsson, (Thu Oct 30, 11:25 am)
Re: Using the --track option when creating a branch, Bill Lear, (Thu Oct 30, 11:42 am)
Re: Using the --track option when creating a branch, Marc Branchaud, (Thu Oct 30, 3:13 pm)
Re: Using the --track option when creating a branch, Pierre Habouzit, (Thu Oct 30, 10:41 am)
Re: Using the --track option when creating a branch, Samuel Tardieu, (Thu Oct 30, 10:56 am)
Re: Using the --track option when creating a branch, Sam Vilain, (Thu Oct 30, 2:00 pm)
Re: Using the --track option when creating a branch, Santi Béjar, (Wed Oct 29, 12:25 pm)
Re: Using the --track option when creating a branch, Bill Lear, (Wed Oct 29, 4:33 pm)