Here is the scenario that happened (I suppose that's how my problem appeared, but not 100% sure) :
- Someone sent a PR, I did merge it but then I reverted it, using the Github
revert
button - He did another PR with the same Commits (plus one to correct the error)
- I merged it (using Github
merge
button) - The commits that has been reverted at the first PR had disappeared from the main repo !
Why did that happened ? How is it possible that now, from the fork that did the PR, it's saying There isn't anything to compare
although those commits are not on the branch original of the distant repo..
And finally, how can I restore those commits ?
EDIT : As requested, here is the interesting par of my git log
:
* | | 25f28fb Merge branch 'FooUser-develop' into develop
|\ \ \
| * \ \ 73768b7 Merge branch 'develop' of https://github.com/FooUser/mainRepo into FooUser-develop
| |\ \ \
| | * | | 2e61235 Invert adresses
* | | | | d522031 Merge branch 'develop' of https://github.com/mainUser/mainRepo into develop
|\ \ \ \ \
| |/ / / /
|/| | | |
| * | | | 1e6e61b Merge pull request #946 from mainUser/revert-945-develop
| |\ \ \ \
| | * | | | 6767f03 (origin/revert-945-develop) Revert "Corrections"
| |/ / / /
| * | | | 5ccc9cd Merge pull request #945 from FooUser/develop
| |\ \ \ \
| | |/ / /
| | * | | 6e0c08b Corrections structuration
| | * | | f7ade9b Correction
| | * | | 4844437 Nb to Str
| | * | | 1729a83 Fix adress
| | * | | ceab88d Corrections: @ssert
| | * | | a3c8d1a #891 Fix
| |/ / /
I apparently lost most of the first commits (#891 Fix
for example).
Searching a bit more, I found for example that some files I added in a3c8d1a
(first commit) were correctly merged on 73768b7
(second to last) - they weren't just beore, on d522031
, because of the Revert - but then disappeared at 25f28fb
(last one).
EDIT 2 : I think the problem was because the fork wasn't sync (he didn't git pull / merge when I accepted his PR and then Reverted it). How could I prevent that ? (by the way to "fix" it I had to Cherry Pick all the commits missing..)
git log --graph --oneline --decorate --all
from your repository? – Zoonosis-10
to the previous command. – Zoonosisgit pull
/merge
when I accepted his PR and then Reverted it). How could I prevent that ? (by the way to "fix" it I had to Cherry Pick all the commits missing..) – Alienation