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

git fetch+rebase on a local tracking branch

From
Kevin Ballard <kevin@sb.org>
Date
Jan 17, 2008, 17:24 UTC
Message-ID
<6C0A045B-658F-4ECE-93DB-A61F77AAA1F8@sb.org>

When I'm working on a local tracking branch, is there an easier way to do `git fetch && git rebase origin/branch`? I could imagine either a config value like branch.master.rebase = remotes/origin/master (although it would be nice to avoid duplicating the remote name, since we already have branch.master.remote), or perhaps a --rebase command to git pull such that it simply performs a rebase instead of a merge.

Is there some reason there isn't already a solution like this, or am I simply missing something?

One of the reasons I really want a hands-off solution to rebasing is I'm somewhat paranoid of accidentally rebasing from origin/master when I'm sitting on another branch. If my branch knows where it's supposed to rebase from in normal usage, that solves the problem.

I'd like to mention that the largest conceptual hurdle in migrating from another VCS is that pull and push are not opposite commands, and that when I'm, say, using a clone of the git repository, unless I'm an integrator I should always rebase instead of merge. Also, fetch+rebase is so common I'm surprised it doesn't already have a single command shortcut.

Please note that I'm not asking for someone else to implement this, I'm simply asking for feedback so, if I choose to go forward on this myself, I don't end up implementing the wrong solution.

-Kevin Ballard
-- 
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
Next: Brandon Casey
Message 1 of 3 in “git fetch+rebase on a local tracking branch”
  1. Kevin BallardJan 17, 2008
  2. Brandon CaseyJan 17, 2008
  3. Kevin BallardJan 17, 2008

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.