After reversing a merge from a Repo to Fork, git does not allow another (already up-to-date)

Asked

Viewed 181 times

1

Good guys!

I have little experience with GIT (so I mostly work with Github Desktop more than with the command line), and today I’ve had some problems with a phpbb theme repository Fork that I’ve been working on.

The first one actually started about 16 days ago. I had specific questions about style development and needed to share the repository code here in the stack. The problem is that Fork is private, I assume because the original repository is private (since I don’t have a premium account on github). So I tried to duplicate the repository in another audience, according to this site’s own tutorial. But I didn’t notice that after performing this procedure my commits were going to the repository-clone, not the original (the private Fork). I only noticed this today when I tried to update the parent repository to Fork (via github desktop) and it did not process the action. After searching for several tutorials on the Internet I downloaded both repositories via the Web and noticed the absence of commits after that date on Fork and all my commits on the clone Remap, including the merge that the desktop github accused as flawed.

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

I then started developing again and realized that this merge shuffled a lot of things in the code structure, and I realized that I needed to reverse that merge. That is where the worst problem began (and the main one of this question).

Initially I tried for Github Desktop, which required me to do it via 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 reverse, in this case the last commit from my Fork) using git revert -m. Apparently he managed to reverse.

However, after being able to reverse this merge via this tutorial, github now insists on telling me that Fork is up to date with the original Reset (both on the command line and in Github GUI), and with that I cannot bring the changes from the parent Reset to Fork, to resolve conflicts correctly.

This is a normal GIT/Github behavior, it’s a bug and the main one: you can sync again or you would need to wait for a new commit there from the parent, and if that’s necessary, it will take ALL 16-day differences here or it will only take the commits created after my failed merge attempt?

Follow the network image through the github website, the red arrow that I put where the blue line (representing the original) joining the black line (my Fork) is the merge that I gave and then revert (the next point after that junction). The points ahead of these are commits that I tried to force an update, unsuccessfully. network

A strong hug to all!

1 answer

0

I managed to solve the problem.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.