简体   繁体   中英

Git: how to track who forced pushed remote code repository?

As we know, Git has a powerful option "-f" with "git push" command, which could change remote code repository history and committed change.

As a pure Git command line user, is there a way to track who just did that kind of thing to notify him/her not to do it again ? Maybe he/she is using some GUI tool and doesn't know what he/she is really doing.

BTW, commit history is ever the root that we can use to check what happened. but git-force-push just changed it so that (sounds like) all clues are lost.

Git itself does not track that information. If you control the server, you could set up a pre- or post-receive hook to record who pushed what and when.

For past occasions, if you use HTTPS or SSH protocols for pushing code, your web/ssh server logs might be of use in identifying past actors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM