How to recover sourceforge repositoryEdit

When it is neededEdit

There will be a slight chance that committers make mistakes to include bad or inappropriate commits to the master branch of original sourceforge repository.  If it is not on the master, it is quite easy.   Just remove it from the origin too, by "git push orign :branch" command.    In the case of master, you must be a bit careful and there's some more to do.

It is not a good idea to make "conpensating" commits because it makes commit log extremely un-readable incomprehensible.   So here's how.   Please note that only committers can do this and this has to be done very very carefully.

Some of the following steps may be unnecessary or can be improved much.   It was written based on Koichi's experience.   Any improvement/comments are welcome.

1. Log in to sourceforge site.Edit

You can do this like:

$ ssh -t who, create

Then you will be prompted for your password.   After then, you will find a couple of symbolic links to project files.   postgres-xc will hold several project files.   postgres-xc/postgres-xc is the origin of our git repository.

2. Create a backup of the whole repository.Edit

You should meka a backup before you do any work directly to this repository.   You may use tar or any other backup command available.

3. Create new masterEdit

Create new_master (or whatever name you like) branch from the master.   Can be done remotely at sourceforge site or locally at your working branch and push it to the origin, but better to do it directly at sourceforge site.

4. Rename master to old_masterEdit

5. Rename new_master to master.Edit

6. Hard-reset unneeded commitsEdit

This has to be done locally, using "git reset --hard commit" command.  You should push this after you are sure the master is correct.

7. Edit HEAD fileEdit

HEAD file will be at the home directory of the repo.   This file points to what is the current "HEAD" in the repo.   At this point this is old_master.   You should edit this to "master" to remove old_master.

8. Remove old_masterEdit