threads / discuss / 9164

RFC: git pull or git rebase?

Subject: RFC: git pull or git rebase?

## tl;dr

3 messages between Jul 23, 2007 and Jul 23, 2007.

replies: 2people: 2as markdown or json

Michael S. Tsirkin· Jul 23, 2007, 05:22 UTC · lore
Hi!
I'm working on several kernel-related projects at the same time:
- some of them are small, and private, so I do a fetch
  and rebase to update to Linus' code, to keep history clean
- some of them are larger, and involve several other people,
  so I do git pull (the history is messy anyway)

Problem is, I get confused sometimes and do a git pull instead of git rebase, or vice versa. Of course I can just reset to ORIG_HEAD when I realise my mistake.

However, I wonder whether this happens to others, too. Would it make sense to add a branch attribute that says "do not pull this branch" or "do not rebase this branch"? Maybe even make git do the right thing automatically, so that git would look at this attribute and perform pull or rebase as appropriate?

Thanks,
-- 
MST
Alex Riesen· Jul 23, 2007, 09:07 UTC · re: Michael S. Tsirkin · lore

Re: RFC: git pull or git rebase?

On 7/23/07, Michael S. Tsirkin <mst@dev.mellanox.co.il> wrote:
Show 6 quoted lines
> However, I wonder whether this happens to others, too.
> Would it make sense to add a branch attribute that says
> "do not pull this branch" or "do not rebase this branch"?
> Maybe even make git do the right thing automatically,
> so that git would look at this attribute and perform
> pull or rebase as appropriate?

If you have a recent enough git, it will refuse to pull into a branch for which there is no configured remote branch. Exactly for a reason like yours.

Michael S. Tsirkin· Jul 23, 2007, 09:31 UTC · re: Alex Riesen · lore

Re: RFC: git pull or git rebase?

Show 14 quoted lines
> Quoting Alex Riesen <raa.lkml@gmail.com>:
> Subject: Re: RFC: git pull or git rebase?
> 
> On 7/23/07, Michael S. Tsirkin <mst@dev.mellanox.co.il> wrote:
> >However, I wonder whether this happens to others, too.
> >Would it make sense to add a branch attribute that says
> >"do not pull this branch" or "do not rebase this branch"?
> >Maybe even make git do the right thing automatically,
> >so that git would look at this attribute and perform
> >pull or rebase as appropriate?
> 
> If you have a recent enough git, it will refuse to pull into
> a branch for which there is no configured remote branch.
> Exactly for a reason like yours.

Aha. I created the tree by git clone, so my master is configured to merge from origin automatically.

-- 
MST

← back to recent threads