* git tip
@ 2009-03-05 22:10 Thiago Jung Bauermann
2009-03-05 22:23 ` Roland McGrath
2009-03-06 22:51 ` Doug Evans
0 siblings, 2 replies; 4+ messages in thread
From: Thiago Jung Bauermann @ 2009-03-05 22:10 UTC (permalink / raw)
To: archer ml
Hi,
Perhaps everyone else knows about this except me, but I thought it would
be useful to share anyway:
To avoid having to type that big remote branch name when you are pushing
to your branch in the archer repo, you can set a default refspec to push
to when you don't specify anything to 'git push'. Just edit .git/config,
and add a line like this to the [remote "origin"] section:
push = <local branch name>:<remote branch name>
In my case this would be:
push = python:archer-tromey-python
So now instead of writing:
% git push origin python:archer-tromey-python
I can just type:
% git push
I don't know yet if you can add multiple push entries in .git/config to
create multiple branch mappings, but perhaps you can.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git tip
2009-03-05 22:10 git tip Thiago Jung Bauermann
@ 2009-03-05 22:23 ` Roland McGrath
2009-03-06 22:51 ` Doug Evans
1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2009-03-05 22:23 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: archer ml
> I don't know yet if you can add multiple push entries in .git/config to
> create multiple branch mappings, but perhaps you can.
You can, and they can have *s in them. Also a leading + implies "-f"
behavior, which is usually what you want for branches that only you push
to (so you can correct snafus without polluting history). See 'man git-push'
for all the details. e.g., this:
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
is what I use in some checkouts where the only local branches I have are
ones that I publish in the given remote repo. (You can also use just
'git push repo', e.g. 'git push origin' when you have a checkout tracking
multiple published repos that you might push to. i.e., select the repo and
let it default the refspec from .git/config.)
Thanks,
Roland
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git tip
2009-03-05 22:10 git tip Thiago Jung Bauermann
2009-03-05 22:23 ` Roland McGrath
@ 2009-03-06 22:51 ` Doug Evans
2009-03-08 4:37 ` Thiago Jung Bauermann
1 sibling, 1 reply; 4+ messages in thread
From: Doug Evans @ 2009-03-06 22:51 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: Project Archer
On Thu, Mar 5, 2009 at 2:10 PM, Thiago Jung Bauermann
<bauerman@br.ibm.com> wrote:
> Hi,
>
> Perhaps everyone else knows about this except me, but I thought it would
> be useful to share anyway:
>
> To avoid having to type that big remote branch name when you are pushing
> to your branch in the archer repo, you can set a default refspec to push
> to when you don't specify anything to 'git push'. Just edit .git/config,
> and add a line like this to the [remote "origin"] section:
>
> push = <local branch name>:<remote branch name>
>
> In my case this would be:
>
> push = python:archer-tromey-python
>
> So now instead of writing:
>
> % git push origin python:archer-tromey-python
>
> I can just type:
>
> % git push
>
> I don't know yet if you can add multiple push entries in .git/config to
> create multiple branch mappings, but perhaps you can.
fwiw, I would love to see a collection of these useful tidbits appear
in the wiki.
It would save a ton of other people's time, I think.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git tip
2009-03-06 22:51 ` Doug Evans
@ 2009-03-08 4:37 ` Thiago Jung Bauermann
0 siblings, 0 replies; 4+ messages in thread
From: Thiago Jung Bauermann @ 2009-03-08 4:37 UTC (permalink / raw)
To: Doug Evans; +Cc: Project Archer
El vie, 06-03-2009 a las 14:51 -0800, Doug Evans escribió:
> fwiw, I would love to see a collection of these useful tidbits appear
> in the wiki.
> It would save a ton of other people's time, I think.
Agreed. I just added this tip to a new section in the
ArcherBranchManagement wiki page.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-08 4:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-05 22:10 git tip Thiago Jung Bauermann
2009-03-05 22:23 ` Roland McGrath
2009-03-06 22:51 ` Doug Evans
2009-03-08 4:37 ` Thiago Jung Bauermann
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 read-only IMAP folder(s) and NNTP newsgroup(s).