0

I recently started working on an open source project called "TFDT : Team Foundation Dev Tools" but I made a mistake to add a std .gitignore and now I want to fix it by adding one from https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore

I've already 10 or so commits by now and I've two branches. Is it still possible to get rid of all undesired files from GitHub's both branches that I've now ?

At the same time I also want to make sure that if someone clones my repository, they should be able to build successfully as long as my code builds on my development machine.

Compatibility : VS 2k 8, 10, 12, 13

ablaze
  • 722
  • 7
  • 30

1 Answers1

0

One solution I have done is to rename the files, check them in, then rename them back to the original file name and check them in again. For example, if you want to gitignore a file called config that is already tracked, add it to .gitignore then:

git mv config config.temp
git commit -am "renaming file for gitignore"
git push origin master
git mv config.temp config
git commit -am "renaming file back to original name"
git push origin master
joncon
  • 105
  • 1
  • 7
  • would it be a horrible idea to remove ( delete ) all such 'qualified' files from a remote branch one at a time ... pushing out the changes ... updating .gitignore and continue working ? Please advise – ablaze Mar 13 '15 at 15:29
  • Sorry, git mv doesn't work. It should be git rm --cached. Or better yet use update-index http://stackoverflow.com/questions/6964297/untrack-files-from-git – joncon Mar 13 '15 at 16:50