tags:

views:

37

answers:

2

I have a git repo that has about 3 or 4 months worth of code. Is there a way to tell git to stop tracking files before a certain commit?

A: 

The following command will stop tracking but keep the file there intact.

git rm --cached filename

and then use a .gitignore file with the filename in it to stop future tracking of that file.

Skawouter
*before* a certain commit.
mathepic
A: 

See http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html

In fact, the example given is perfect! (slightly modified)

git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' <COMMIT>
mathepic