I am using a git repository with github. With all the commits and logs I have in the repository , now I need to remove all the commits from a specific user ( say User1) . How do I remove all his commits ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. The man page of
git filter-branchprovides a ready-made example: this removes all commits from “Darl McBribe” from the working tree (in your case, this would beUser1).where the function
skip_commitis defined as follows:But, as always when changing the history of your repo: if someone pulled from the repo before you modify it, he’ll be in trouble.