Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6338905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:32:28+00:00 2026-05-24T19:32:28+00:00

I am using a git repository with github. With all the commits and logs

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:32:29+00:00Added an answer on May 24, 2026 at 7:32 pm

    Yes. The man page of git filter-branch provides a ready-made example: this removes all commits from “Darl McBribe” from the working tree (in your case, this would be User1).

    git filter-branch --commit-filter '
        if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ];
        then
                skip_commit "$@";
        else
                git commit-tree "$@";
        fi' HEAD
    

    where the function skip_commit is defined as follows:

    skip_commit()
    {
        shift;
        while [ -n "$1" ];
        do
                shift;
                map "$1";
                shift;
        done;
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using one file from a git repository off of github in a project
I'm trying to fetch a read-only git repository from github and have it be
I have a Gem that I need to install it from github using bundler
I have a git repository which tracks an svn repository. I cloned it using
In my repository, I have created tags using the following commands. git tag v1.0.0
(Using Vista)I'm trying to clone an app from my GitHub Repository and push it
I cloned a Git repository from my GitHub account to my PC. I want
I am developing an app and version-control it using git at github. Now there
I have repository on both github.com and bitbucket.org, and I am very familiar using
I have a github-based git repository that represents development up to a certain point,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.