1

I originally have main and branch A. Then I merged them. Then I modified something locally but saw 5k changes after I did "git add .". Then the origin remote disappeared (nothing returned after I did "git remote -v"). So I added a new remote origin with the same git remote url as deleted git("git add remote [git url]). But I only saw "master" branch. I did not name such a branch name. So I did "git pull --all". I then saw all branches pulled locally (main, branch A and master branch). Then the merge trouble began after I tried to merge master branch to main( "git merge origin master"). The error is as below. I checked every file and there's nothing I need to resolve. This whole thing caused failure of my Heroku deployment. I'm very anxious to get this fixed. Any hints and advice would be so appreciated!

error: Merging is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm ' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict.

1
  • 1
    This sounds like the terrible sorts of things that happen if you put a repository into a Dropbox folder or the like. (Don't do that!) Commented Mar 26, 2021 at 10:11

1 Answer 1

1

Then I modified something locally but saw 5k changes after I did "git add .". Then the origin remote disappeared

Check first if you still have a .git subfolder in the right parent repository folder (and not in an ancestor folder, like $HOME or %USERPROFILE%, where all your files would be candidate to be tracked)

I would rather:

  • rename with local cloned folder as 'tmprepo'
  • clone again your remote repository
  • report any modified files from tmprepo to your local cloned (again) repository
  • add, commit and push
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.