Someone has deleted a remote git branch (I had not a local copy of it). Is it possible to find who and when deleted the branch?
Note that if you have access to the remote repo (to which a branch deletion was pushed), you can find trace of the deleted branch in the git reflog . This user is first on the weekly GitLab leaderboard. The reflog for the branch gets deleted when you delete the branch.
Restoring a deleted branchOn GitHub.com, navigate to the main page of the repository. Under your repository name, click Pull requests. Click Closed to see a list of closed pull requests. In the list of pull requests, click the pull request that's associated with the branch that you want to restore.
They remain exactly as they were. If the branch is deleted without being merged into another branch then the commits in that branch (up until the point where the forked from a commit that is still reachable) will cease to be visible.
If you have access to the remote repository (and it was done recently), you can use reflog
to find out when the branch was deleted. You can then create a branch on that commit to recover it if needed.
The gitolite documentation gives some more information.
In general, no, unless you have utilized the various hooks to do some sort of logging, or configured git-daemon
to log connections, or if you use ssh
connections, your syslog
configuration might have captured enough information to correlate with.
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