git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Process of updating a local branch from another with tracking
@ 2014-02-12 21:55 Robert Dailey
  2014-02-13  8:42 ` Chris Packham
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Dailey @ 2014-02-12 21:55 UTC (permalink / raw)
  To: Git

I have the following alias defined:
sync = "!f() { cbr=$(git rev-parse --abbrev-ref HEAD); git co $1 &&
git pull && git co $cbr && git rebase $1; }; f"

The goal is to basically update a local branch which tracks a branch
on a remote, and then rebase my local topic branch onto that updated
local branch.

I do this instead of just rebasing onto origin/master. Example:

git checkout master
git pull --rebase origin master
git checkout topic1
git rebase master

I could do this instead but not sure if it is recommended:

git checkout topic1
git fetch
git rebase origin/master

Any thoughts on the alias I created? I'm a Windows user and still new
to linux stuff, so if it sucks or could be simplified just let me
know.

And as a secondary question, just curious what people think about
rebasing onto a remote tracking branch. When I do merges I usually
refer to the remote branch, but during rebase I use the local branch
instead, but I don't know if there is any functional reason to not
skip the local branch and go straight to the remote tracking branch
(it saves a step).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-13  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 21:55 Process of updating a local branch from another with tracking Robert Dailey
2014-02-13  8:42 ` Chris Packham

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).