After reverting a merge from a repo to the fork, git does not allow another (already up-to-date)

1

Good people!

I have little experience with GIT (so I mostly work with Github Desktop rather than the command line), and today I had some issues with a fork from the repository of a phpbb theme I've been working on.

The first one actually started about 16 days ago. I had specific style development doubts and needed to share the repository code here on the stack. The problem is that the fork is private, I assume it's because the original repository is also (since I do not have a premium account in github). So I tried to duplicate the repository in another audience, as this tutorial from the site itself . But I did not notice that after performing this procedure my commits were going to stop in the repository-clone, not in the original (the private fork). I just noticed this today when I tried to do an update to the parent repository for the fork (via github desktop) and it did not process the action. After searching for several tutorials on the internet I accessed both repositories via the web and noticed the absence of commits after that on the fork and all my commits in the repo clone, including the merge that the github desktop accused of being flawed.

I was able to solve this problem by repeating the above tutorial only with the "inverted" repositories: I copied from the clone to the fork. Apparently the problem was solved.

I then resumed developing and realized that this merge shuffled various things in the code structure, and I realized that I needed to reverse that merge. That's where the worst problem started (and the main question).

Initially I tried Github Desktop, which required me to do it via the command line (the explanation I found was because this type of merge has 2 commits parent, and I needed to reference which one I wanted to revert, in case the last commit of my fork) using git revert -m . Apparently he managed to reverse.

However, after being able to revert this merge via this tutorial, github now insists on saying that the fork is updated with the original repo (both on the command line and in Github GUI), and with that I can not bring the repo changes from parent to fork, to correctly resolve conflicts.

This is a normal behavior of GIT / Github, it is a bug and the main one: it is possible to synchronize again or it would be necessary to wait for a new commit there from the parent repo, and if it is necessary, it will get ALL the differences of 16 days or will you just get the commits you created after my failed merge attempt?

Follow the image of the network by the github website, the red arrow that I placed where the blue line (representing the original repo) joining the black line (my fork) is the merge that I gave and then reversed the next point after this join). The points ahead of these are commits that I tried to force to force an update, without success.

A big hug to everyone!

    
asked by anonymous 11.02.2016 / 03:29

1 answer

0

I solved the problem.

I had to give a git reset --hard <ultima commit antes do merge> and then a git push --force to force the change on the server.

    
11.02.2016 / 04:36