I committed several changes in local, then pushed them to github. I went to the github website, and I could see the commit I just pushed.
Several hours later, when I went back to github, the commits that I made were missing. How can I know what happen to these commits? Why are they not on github any more? How can I know if my colleague delete it or reset it? I can find the commits on github which are made behind me, but those new commits are not related to my commits and the code I made the change.
p.s. I have the commit id for those missing commits.
One of your colleagues might have force pushed to the same branch, overwriting history and removing your commits. Force pushing is not the norm though and often frown upon. So my best guess is actually that you might be looking at wrong branch/repository. Otherwise there's no way to know who force pushed to the branch since he can in theory just force push to master without any new commits of his own. If he did push with some commits, any author of commits after your commit locally could be the culprit.
But as I've said, check your local branch, check the repository URL and compare with what's on github.
To check your branch, run git branch the branch with star (*) will be your current branch.
To check what are your remote repositories, run git remote -v check the remote you pushed to is same repo on github, ie. it is not hosted on your forked repo for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With