GIT pull conflict: how come not on any branch? -


i have branch checked out , edit , commited file. in meanwhile, else pushed changed same file.

when git pull, see

first, rewinding head replay work on top of it... applying: add new line applying: create 1 conf using index info reconstruct base tree... falling patching base , 3-way merge... auto-merging <filename> conflict (add/add): merge conflict in <filename> recorded preimage '<filename>' failed merge in changes. patch failed @ 0002 create 1 conf when have resolved problem run "git rebase --continue". if prefer skip patch, instead run "git rebase --skip". restore original branch , stop rebasing run "git rebase --abort". 

i tried manually resolve conflict in file, see not on branch. wondering why happening.

git status # not on branch. # untracked files: 

this normal. need fix file , follow rebase instructions - --continue.

you resolve issue by

  1. edit files resolve conflict
  2. perform git checkout --ours -- <filenames> if know version good
  3. perform git checkout --theirs -- <filenames> if theirs good.

follow of these git add <filenames>. note --ours , --theirs can swapped in cases might expect; check file checked-out if use options 2 or 3.

conclude git rebase --continue (which commit you). if decide abort sure use git rebase --abort git can out of 'not on branch' condition.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -