tags:

views:

284

answers:

2

I've started switching my private subversion projects to git (Github) and release the code to the public. Therefore, I am a git newbie.

Unfortunately, there is a revision of a project that contains confidential data. The revision is not tagged, I just know its hash value.

Is there a way to completely erase that particular revision from the remote git repository? It is a solo project, so nobody will be harmed from the operation.

A: 

What do you mean by "remote"? If it's a solo project, why is there a "remote" repo? Or is this the one people pull from?

If it is solo, then can't you just delete (as in filesystem delete, or reset back to the first commit and fast forward it, etc) the "remote" git repo, and just replace it with your modified version? :)

Of course, this assumes you know how to delete a revision from your local repository?

Pod
It used to be a solo project because I'm opening the code right now. I imported the repository by following the tutorial on http://github.com/guides/import-from-subversionThen I realized that there was a commit containing confidential data. I don't know how to delete only that revision from both github and my local clone.I opened the repository on github, so the code is mine (and will be released under GPLv3 license)
bodom_lx
+1  A: 

The post located here solved my problem.

If the commit you want to fix isn’t the most recent one:

  1. git rebase --interactive $parent_of_flawed_commit

    If you want to fix several flawed commits, pass the parent of the oldest one of them.

  2. An editor will come up, with a list of all commits since the one you gave.

    1. Change pick to edit in front of any commits you want to fix.
    2. Once you save, git will replay the listed commits.
  3. Git will drop back to the shell for every commit you said you want to edit:

    1. Change the commit in any way you like.
    2. git commit --amend
    3. git rebase --continue

Most of this sequence will be explained to you by the output of the various commands as you go. It’s very easy, you don’t need to memorise it – just remember that git rebase --interactive lets you correct commits no matter how long ago they were.

bodom_lx
thanks for the formatting, jleedev
bodom_lx