Skip to content

Instantly share code, notes, and snippets.

@jiewpeng
Created July 20, 2018 13:51
Show Gist options
  • Save jiewpeng/753ee99d83a0e313bec3d82eb7ed5293 to your computer and use it in GitHub Desktop.
Save jiewpeng/753ee99d83a0e313bec3d82eb7ed5293 to your computer and use it in GitHub Desktop.
Useful things to have in .gitattributes

Useful .gitattributes

Strip output from Jupyter Notebooks

  1. First, install nbstripout:
conda install -c conda-forge nbstripout
nbstripout --install
  1. Then, put the following lines in the .gitattributes file:
* text=auto
*.ipynb filter=nbstripout
*.ipynb diff=ipynb

Large files in git repo

  1. Install git large file system (lfs)
git lfs install
  1. Then track files:

Either git lfs track "model/*.h5" or add model/*.h5 filter=lfs diff=lfs merge=lfs -text in .gitattributes

git auto-language fix

If the language is not displaying correctly because of certain things e.g. hosting static files, add 'linguist-vendored' to the file/s in .gitattributes:

static/* linguist-vendored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment