I made 5 commits for the master branch when I looked for an error in a private project and pushed them to a remote source (my own private vps).
Then I saw that commits 4 and 5 would cause problems elsewhere, and I need to cancel them, so I checked commit 3 again, made a new “Dev” branch from that point and made a few more fixes fixing the problem properly.
Then i did
git reset - hard HEAD ~ 2 on Master to return it to the point where I forked Dev.
Then I did a git merge to speed forward to the end of the Dev branch.
So now I have a local repository with Dev and Master, which point to the same updated version of the project with the latest bug fix.
The problem is that when I try to push the project to the beginning, it fails and gives me an error message:
! [rejected] master → master (no fast forward) Error: could not click some links to "myserver ... myproject.git"
What have I done wrong and how to fix it?
thank
source
share