Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

How can I find out who force pushed in git?

Someone used git push --force but I can't tell who did it from the logs. Is there a way to identify the culprit?

question from:https://stackoverflow.com/questions/15028246/how-can-i-find-out-who-force-pushed-in-git

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Update Nov. 2018: if you are pushing to a centralized Git repository hosting service like GitHub, then you would be able to see who has forced push your branch. But only because GitHub has chosen to surface that event in its GUI.

https://pbs.twimg.com/media/DsJIVxtU4AAreMW.jpg:large

See more at "Find committer of a force push on GitHub".


Original answer 2013:

As I mention in "Distributed Version Control Systems and the Enterprise - a Good mix?", there is no authorization or authentication with Git alone.

You need an authorization layer like Gitolite in order to keep track of who does what. (Gitolite comes with its own audit trail mechanism).

But if your repo is accessible through file (or local) protocol, then you cannot know who forced pushed.

polygraph (from motivationalgenerator.com, and wikipedia)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...