# git fetch+rebase on a local tracking branch

3 messages from 2008-01-17 to 2008-01-17. Participants: Kevin Ballard, Brandon Casey.
Thread: https://gitlist.dev/t/11657

## Kevin Ballard, 2008-01-17 17:24

Subject: git fetch+rebase on a local tracking branch
Message-ID: <6C0A045B-658F-4ECE-93DB-A61F77AAA1F8@sb.org>
URL: https://gitlist.dev/e/6C0A045B-658F-4ECE-93DB-A61F77AAA1F8%40sb.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



```

## Brandon Casey, 2008-01-17 17:33

Subject: Re: git fetch+rebase on a local tracking branch
Message-ID: <Pine.LNX.4.64.0801171129430.31161@torch.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0801171129430.31161%40torch.nrlssc.navy.mil
In-Reply-To: <6C0A045B-658F-4ECE-93DB-A61F77AAA1F8@sb.org>

```
On Thu, 17 Jan 2008, Kevin Ballard wrote:

> 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?

It exists in master.

commit cd67e4d46b122b161f2ad7d943e4ae7aa8df6cf5
Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Date:   Wed Nov 28 13:11:07 2007 +0000

     Teach 'git pull' about --rebase

...

-brandon

```

## Kevin Ballard, 2008-01-17 17:44

Subject: Re: git fetch+rebase on a local tracking branch
Message-ID: <E9B7A445-89FE-49F6-9314-78E5D0095369@sb.org>
URL: https://gitlist.dev/e/E9B7A445-89FE-49F6-9314-78E5D0095369%40sb.org
In-Reply-To: <Pine.LNX.4.64.0801171129430.31161@torch.nrlssc.navy.mil>

```
On Jan 17, 2008, at 12:33 PM, Brandon Casey wrote:

> On Thu, 17 Jan 2008, Kevin Ballard wrote:
>
>> 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?
>
> It exists in master.
>
> commit cd67e4d46b122b161f2ad7d943e4ae7aa8df6cf5
> Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Date:   Wed Nov 28 13:11:07 2007 +0000
>
>    Teach 'git pull' about --rebase

Excellent. I've been using master, but apparently I forgot to update  
my manpages. Glad to see this problem's been solved.

Thanks,
Kevin Ballard

-- 
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com



```
