Git merge branch already up to date, yet has modifications pending
I’m new to git, and have two branches i’m trying to merge (newDevelopment and master). I messed up the file tracking somehow on my newDevelopment branch, and because so, I cannot merge the changes into master. I’ve tried renaming the branch and merging to no avail.
Here’s what i’m looking at:
- Merge from upstream branch to vendor branch, where vendor branch contains a subset of the upstream commits
- Whats the Proper usage of .gitattributes with merge=ours
- Remove a merge from master
- Git squash and merge
- How do I retrieve lost changes in a git repo?
- Why does git produce a merge conflict when when lines next to each other are changed?
blabla@ip:/vol/apps/staging/current$ git diff --name-status newDevelopment..master M app/admin/reports.rb M config/resque_schedule.yml blabla@ip:/vol/apps/staging/current$ git branch MoreDetailsReport * master newDevelopment blabla@ip:/vol/apps/staging/current$ git merge newDevelopment Already up-to-date.
How do I fix this? Thanks!
One Solution collect form web for “Git merge branch already up to date, yet has modifications pending”
It looks like that you have already merged
master, and when you did it, you ignored some changes (reset them) and committed the merge. As a result,
master has all revisions from
newDevelopment, and so there’s nothing more to merge into it. But the branches are different, because of the changes you ignored.
One way to fix is to make a copy of your branch for backup, then reset its history to the point before you messed things up:
git branch master-bak git reset --hard SHA1
Find the right SHA1 using
git log, probably it’s a merge commit. After that, repeat the merge that went wrong.
Another, not so good way to fix is to get those files with the changes from the other branch:
git checkout newDevelopment -- app/admin/reports.rb git checkout newDevelopment -- config/resque_schedule.yml
And then use
git diff --cached to review the differences.