Merging into a current branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Merging into a current branch

From: Geoff Russell <hidden>
Date: 2016-06-15 22:43:24

Dear gits,

Is there any reason why

git fetch origin branchX:branchX

fails if I am on branchX?   All I want to do is fast forward it.

Cheers,
Geoff.

Re: Merging into a current branch

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:24

Geoff Russell [off-list ref] wrote:
Is there any reason why

git fetch origin branchX:branchX

fails if I am on branchX?   All I want to do is fast forward it.
Yes.

A fetch will *only* update the branch.  If the branch is your current
branch it won't update the working directory.  This safety check
is to prevent the branch from updating, but the working directory
staying unchanged, and the resulting git-status output looking like
you just undid all of the recent work done on branchX of origin.

Try git-pull instead:

  git pull origin branchX


-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help