1

I pulled an external repo locally to my folder which is connected with origin master of my personal repo. The files from the external one got pulled, except the README.md and I got an error when I pulled, about a merging error with my local README.md file.

Then I did some work, I wanted to push my changes to my repo but got

Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution, or use 'git commit -a'. 

I deleted the readme file and tried to push again, but same problem. And I don't want to add --all to a single commit, because the changes are for different contexts and I want to separate into different commits.

I tried git checkout --ours README.md and --theirs README.md and then other operations but still no success.

How can I fix this without a UI merging tool, but only through terminal? (I have no unpushed commits locally, atm).

P.S. sorry if I messed up with some terminology - I am just a beginner with git.

Git status:

You have unmerged paths. (fix conflicts and run "git commit") Changes to be committed: new file: ../bday-picker.js new file: ../bday-picker.min.js new file: ../index.html ..other files Unmerged paths: (use "git add <file>..." to mark resolution) both added: ../README.md 

And now I also am thinking why are these 3 new files listed , because I deleted them manually through the folder...

1
  • @minitech , awesome! That did the job! You are welcome to post it as an answer, so I can accept it and other ppl can benefit. @ ComputerDruid, thanks for that suggestion! I also saw many other files that I cleaned up from my working tree. Commented Feb 28, 2015 at 18:30

1 Answer 1

2

Your git status shows that you’re already in the middle of a merge; you’ll need to abort that merge before trying again. Run git merge --abort, then check git status again and clean up anything there, then pull.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.