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 624047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:09:31+00:00 2026-05-13T19:09:31+00:00

I want to change something in the first commit of my project with out

  • 0

I want to change something in the first commit of my project with out losing all subsequent commits. Is there any way to do this?

I accidentally listed my raw email in a comment within the source code, and I’d like to change it as I’m getting spammed from bots indexing GitHub.

  • 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-13T19:09:31+00:00Added an answer on May 13, 2026 at 7:09 pm

    As mentioned by ecdpalma below, git 1.7.12+ (August 2012) has enhanced the option --root for git rebase:

    “git rebase [-i] --root $tip” can now be used to rewrite all the history leading to “$tip” down to the root commit.

    That new behavior was initially discussed here:

    I personally think “git rebase -i --root” should be made to just work without requiring “--onto” and let you “edit” even the first one in the history.
    It is understandable that nobody bothered, as people are a lot less often rewriting near the very beginning of the history than otherwise.

    The patch followed.


    (original answer, February 2010)

    As mentioned in the Git FAQ (and this SO question), the idea is:

    1. Create new temporary branch
    2. Rewind it to the commit you want to change using git reset --hard
    3. Change that commit (it would be top of current HEAD, and you can modify the content of any file)
    4. Rebase branch on top of changed commit, using:

      git rebase --onto <tmp branch> <commit after changed> <branch>`
      

    The trick is to be sure the information you want to remove is not reintroduced by a later commit somewhere else in your file. If you suspect that, then you have to use filter-branch --tree-filter to make sure the content of that file does not contain in any commit the sensible information.

    In both cases, you end up rewriting the SHA1 of every commit, so be careful if you have already published the branch you are modifying the contents of. You probably shouldn’t do it unless your project isn’t yet public and other people haven’t based work off the commits you’re about to rewrite.

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

Sidebar

Related Questions

I want to change the text from User Account to something else when users
i have many div's with the same background image and i want change this
I want to change a number to a string like this: var i =
In a project I started out with MySQL as database. Instead of checking first,
I am working on my bachelor thesis (this is my first research project) and
First of all I want to say that I'm completely new to maven. So
I guess I am spoiled with JavaScript. If you want to change something about
I couldn't find much information on this. I want to compile all css (and
I've been studying Python for two weeks and there's something I want to know
i want change the content of a UITableView when i change a button, how

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.