I'm trying to implement Git to manage creative assets (Photoshop, Illustrator, Maya, etc.), and I'd like to exclude files from Git based on file size rather than extension, location, etc.
For example, I don't want to exclude all .avi files, but there are a handful of massive +1GB avi files in random directories that I don't want to commit.
Any suggestions?
Open the .gitignore and ignore .csv filesIn your text editor, open the . gitignore file and add *. csv under 'Ignored files'. This tells git to ignore any file that ends with .
Delete large file. then click on the "view"(window file) view-> check hidden folder then you will be able to see '. git' file delete . git file this will delete all your commit history Then you can push your repo like new one...
gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple . gitignore files.
I'm new to .gitignore, so there may be better ways to do this, but I've been excluding files by file size using:
find . -size +1G | cat >> .gitignore
Obviously you'll have to run this code frequently if you're generating a lot of large files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With