From: Jeff King <peff@peff.net>
To: Gelonida <gelonida@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: how to push from repository with two tracking branches
Date: Thu, 13 May 2010 07:57:48 -0400 [thread overview]
Message-ID: <20100513115747.GC10963@coredump.intra.peff.net> (raw)
In-Reply-To: <hsgfjn$onv$1@dough.gmane.org>
On Thu, May 13, 2010 at 11:09:11AM +0200, Gelonida wrote:
> I have a repository with two tracking branches ('master' and 'mybranch')
>
> with only one tracking branch I can do
> git pull
> make_local_changes
> git commit -a
> git push
>
> with two tracking branches I will be told off if the other branch has
> been updated meanwhile, so what I currently to do is:
How about "git push origin mybranch" to just push mybranch? You might
also want to look at "push.default" in "git help config".
> # 'pull and fastforward mybranch'
> git checkout mybranch
> git pull
> git checkout master
>
> [...]
>
> How can I do this more efficiently?
> after a pull to master (I just had to fast forward mybranch to
> remote/mybranch)
> Switching branches and pulling seems a little clumsy
Pull requires a working tree because a non-fast forward merge may need
to resolve conflicts. So yes, you could be more efficient if it is a
fast-forward (you would "git fetch", check to make sure it is a
fast-forward, and then write the fast-forwarded commit sha1 into the
ref), but in the worst case you may need to actually do the merge.
-Peff
next prev parent reply other threads:[~2010-05-13 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-13 9:09 how to push from repository with two tracking branches Gelonida
2010-05-13 11:57 ` Jeff King [this message]
2010-05-13 12:12 ` Thomas Rast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100513115747.GC10963@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=gelonida@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).