3

I have updated files in my local instance and my git have 3 days old files. So i want to commit my changes for that i done following command to merge changes in git and my local instance

  1. Sudo git pull --> pulling files from git

So it will give some error like i have some updated files that are not in git , so i want to merge it or not.

2.sudo git stash --> moving my updated files to buffer (saving my changes in buffer)

3.sudo git pull --> pulling old files from git to my local instance again

  1. sudo git stash pop --> merging my local buffer files to local instance( i got old files from git now)

so i got following error

controller.php: needs merge unable to refresh index 

So now my entire local instance turned to set of old files, iam not able to merge my buffer changes to my local instance pls help

1 Answer 1

1

You can see a similar error message in "Git stash pop- needs merge, unable to refresh index".

In your case, you would need to resolve the merge (fixing merge conflicts) in order for the stash to proceed.

To reset a merged file, the OP used:

git reset HEAD -- filename 
Sign up to request clarification or add additional context in comments.

19 Comments

i removed that merge messages from file and try to commit some other file so i got this error error: 'commit' is not possible because you have unmerged files.hint: Fix them up in the work tree, hint: and then use 'git add/rm <file>' as hint: appropriate to mark resolution and make a commit, hint: or use 'git commit -a'. fatal: Exiting because of an unresolved conflict.
@user3755198 what does git status returns?
@user3755198 that means you still have files with merge markers in it, that you need to remove.
is there any way to see what all files i have merged markers?
@user3755198 yes: git status See for instance help.github.com/articles/…
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.