To satisfy github 100Mb requirement, I run the following to ignore some large files:
$ find ./* -size +100M | cat >> .gitignore
but when I run add * later, it is still adding the >100MB file to commit.
$ git add *
warning: LF will be replaced by CRLF in hw1/input/act_test.csv.
The file will have its original line endings in your working directory
How can I make this gitignore work? Thanks in advance for ideas and advices.
add:
my intent is to make add *
not track the large csv file any more, following answer does not seem to work.
Previously added files are not affected by, adding them later to gitignore. Take a backup of the files and delete the files locally and commit them. So, that they are not tracked by git. Now, Paste back the files to the original place and you can add the bigger filenames to gitignore. Now, git will not be tracking them, as they are considered fresh files.
Another way is to use, as suggested by @alfunx, git rm --cached <file>
. The file will be removed from cache(index) and once you commit, the file will not be tracked anymore. You can also update .gitignore accordingly to avoid any further tracking of the file.
Read more about it in gitignore documentation
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below for details.
[...]
NOTES
The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked.
To stop tracking a file that is currently tracked, use
git rm --cached
.