0

I added some of the temp files to git repository and pushed it to the web repo. Now I want to clean the web repository and delete those temporary files. Please help me with the procedure. I've followed the procedure given in Completely remove file from all Git repository commit history , but I'm getting a problem at the command #git commit --amend where it says to use --allow-empty along with the command. On doing as directed and completing the whole process, I can see that the files are not deleted from web repository.

What is the procedure to permanently remove files from my web repo?

Community
  • 1
  • 1
D S
  • 1

1 Answers1

0

Well, one simple thing you could try is to delete the files on your local repository, commit and push. This means that the files will disappear and will only be present on the previous commit.

This is probably the simplest approach. If you want your files to disappear from the entire web repository too, then things start getting complicated.

Carl
  • 43,122
  • 10
  • 80
  • 104
  • Thanks for the reply. But as for GIT, wont it be the case that all the files irrespective that they are present in the present commit or not, will be carried over to the subsequent commits. So, if someone clones the web repo, he would get all the files starting from the first commit which I precisely dont want to happen. – D S Oct 20 '11 at 19:45
  • Yes. However, if you specifically delete the file in your local work tree, git will detect that the file has been deletion and will mark it for deletion in the repository. When you push that commit, the file will also no longer exist from that commit onwards. That said, someone who gets the repo can get the commit with the files ane view them. – Carl Oct 20 '11 at 20:11
  • If you want to be sure that the files do not exist at all in any commit on the remote repo, you'd want to follow these steps: http://help.github.com/remove-sensitive-data/ – Carl Oct 20 '11 at 20:13
  • One last point - you need to know that if anyone has pulled your repository, unless you can get them to rebase, they will always have a copy of the files. Therefore, if it is in your control, I'd lock down your repository until you have solved the problem. – Carl Oct 20 '11 at 20:16