'Git merge conflict with my previous commit when pushing my actual commit
I'm working on a project where I'm the only person committing. There is only one branch local and remote (master). My local project is up to date (pulled all changes which should be not necessary since only me is working on there).
If I make changes to my local files, pull, commit, and try to push, I have to merge with my previous commit. I tried deleting my local branch and cloning it again. But that doesn't solve the problem.
How I maybe got there I made a commit and don't push it to save my changes. Go back one commit with git reset hard to test how it worked before. Due to this reset hard my save commit got lost (maybe not but I couldn't find it). I don't think deleting a commit works this way. So after testing with this previous comment, I want to be back to my save commit. Since I couldn't find it and get I wanted to go to the head. I somehow get there (with reset, pull) so my local branches head and the remote hadn't any difference.
Best regards
Solution 1:[1]
I resolved the problem by using the git command line. I used it to add, commit and push one commit. Since then the git implementation in the IDE has also worked.
git status
and git log --graph --oneline --all
showed before a commit, with the IDE, no problems. After committing with the IDE there was also the merge conflict visible.
After using the command line to do one commit the git implementation in the IDE also worked fine for the next commits.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Daniel |