git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: easy way to make tracking branches?

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jan 18, 2009, 15:53 UTC
Message-ID
<20090118155338.GK11992@leksak.fem-net>
In-Reply-To
<slrngn6j4t.9he.sitaramc@sitaramc.homelinux.net>
Hi,
Sitaram Chamarty wrote:
Show 8 quoted lines
> > Now I want to make "foo" a tracking branch for "bar".
> > I do:
> >
> > 	git config branch.foo.remote srv
> > 	git config branch.foo.merge refs/heads/bar
> 
> I just do a "git pull srv" when the tracking is *not* setup,
> and git reminds me what commands to use.
Oh, this is great! (Just tested.)

Usually (in my use case) there is no need to pull before I set up a tracking branch, so I never tried this.

And git only reminds you if you have no tracking branch set for srv yet. But that's no problem, because if one is set I can copy&paste the lines in .git/config.

Altogether, this is a solution I can live with.
Show 5 quoted lines
> > And to get a comfortable git-push, I do:
> >
> > 	git config --add remote.srv.push foo:bar
> 
> This one you'll just have to remember, I guess :-)
This is not too hard. :-)
Show 9 quoted lines
> > 	git checkout -b foo2 srv/bar
> > 	git branch -d foo
> > 	git branch -m foo
> >
> > which is suboptimal because deleting foo can remove some
> > other settings for the branch, e.g. mergeoptions.
> 
> it also doesn't seem to set remote.srv.push, as far as I can
> tell.
Right.
Thanks,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Sitaram Chamarty
Message 3 of 3 in “easy way to make tracking branches?”
  1. Stephan BeyerJan 18, 2009
  2. Sitaram ChamartyJan 18, 2009
  3. Stephan BeyerJan 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.