├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── _config.yml ├── generate.py └── requirements.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | #common settings that generally should always be used with your language specific settings 2 | 3 | # Auto detect text files and perform LF normalization 4 | # http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ 5 | * text=auto 6 | 7 | # 8 | # The above will handle all files NOT found below 9 | # 10 | 11 | # Documents 12 | *.doc diff=astextplain 13 | *.DOC diff=astextplain 14 | *.docx diff=astextplain 15 | *.DOCX diff=astextplain 16 | *.dot diff=astextplain 17 | *.DOT diff=astextplain 18 | *.pdf diff=astextplain 19 | *.PDF diff=astextplain 20 | *.rtf diff=astextplain 21 | *.RTF diff=astextplain 22 | *.md text 23 | *.adoc text 24 | *.textile text 25 | *.mustache text 26 | *.csv text 27 | *.tab text 28 | *.tsv text 29 | *.sql text 30 | 31 | # Graphics 32 | *.png binary 33 | *.jpg binary 34 | *.jpeg binary 35 | *.gif binary 36 | *.tif binary 37 | *.tiff binary 38 | *.ico binary 39 | # SVG treated as an asset (binary) by default. If you want to treat it as text, 40 | # comment-out the following line and uncomment the line after. 41 | *.svg binary 42 | #*.svg text 43 | *.eps binary 44 | # Basic .gitattributes for a python repo. 45 | 46 | # Source files 47 | # ============ 48 | *.pxd text 49 | *.py text 50 | *.py3 text 51 | *.pyw text 52 | *.pyx text 53 | 54 | # Binary files 55 | # ============ 56 | *.db binary 57 | *.p binary 58 | *.pkl binary 59 | *.pyc binary 60 | *.pyd binary 61 | *.pyo binary 62 | 63 | # Note: .db, .p, and .pkl files are associated 64 | # with the python modules ``pickle``, ``dbm.*``, 65 | # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` 66 | # (among others). 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Unneeded Git Folders 2 | gitattributes/ 3 | gitignore/ 4 | 5 | # Created by https://www.gitignore.io/api/linux,macos,python,windows 6 | # Edit at https://www.gitignore.io/?templates=linux,macos,python,windows 7 | 8 | ### Linux ### 9 | *~ 10 | 11 | # temporary files which can be created if a process still has a handle open of a deleted file 12 | .fuse_hidden* 13 | 14 | # KDE directory preferences 15 | .directory 16 | 17 | # Linux trash folder which might appear on any partition or disk 18 | .Trash-* 19 | 20 | # .nfs files are created when an open file is removed but is still being accessed 21 | .nfs* 22 | 23 | ### macOS ### 24 | # General 25 | .DS_Store 26 | .AppleDouble 27 | .LSOverride 28 | 29 | # Icon must end with two \r 30 | Icon 31 | 32 | # Thumbnails 33 | ._* 34 | 35 | # Files that might appear in the root of a volume 36 | .DocumentRevisions-V100 37 | .fseventsd 38 | .Spotlight-V100 39 | .TemporaryItems 40 | .Trashes 41 | .VolumeIcon.icns 42 | .com.apple.timemachine.donotpresent 43 | 44 | # Directories potentially created on remote AFP share 45 | .AppleDB 46 | .AppleDesktop 47 | Network Trash Folder 48 | Temporary Items 49 | .apdisk 50 | 51 | ### Python ### 52 | # Byte-compiled / optimized / DLL files 53 | __pycache__/ 54 | *.py[cod] 55 | *$py.class 56 | 57 | # C extensions 58 | *.so 59 | 60 | # Distribution / packaging 61 | .Python 62 | build/ 63 | develop-eggs/ 64 | dist/ 65 | downloads/ 66 | eggs/ 67 | .eggs/ 68 | lib/ 69 | lib64/ 70 | parts/ 71 | sdist/ 72 | var/ 73 | wheels/ 74 | *.egg-info/ 75 | .installed.cfg 76 | *.egg 77 | MANIFEST 78 | 79 | # PyInstaller 80 | # Usually these files are written by a python script from a template 81 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 82 | *.manifest 83 | *.spec 84 | 85 | # Installer logs 86 | pip-log.txt 87 | pip-delete-this-directory.txt 88 | 89 | # Unit test / coverage reports 90 | htmlcov/ 91 | .tox/ 92 | .nox/ 93 | .coverage 94 | .coverage.* 95 | .cache 96 | nosetests.xml 97 | coverage.xml 98 | *.cover 99 | .hypothesis/ 100 | .pytest_cache/ 101 | 102 | # Translations 103 | *.mo 104 | *.pot 105 | 106 | # Django stuff: 107 | *.log 108 | local_settings.py 109 | db.sqlite3 110 | 111 | # Flask stuff: 112 | instance/ 113 | .webassets-cache 114 | 115 | # Scrapy stuff: 116 | .scrapy 117 | 118 | # Sphinx documentation 119 | docs/_build/ 120 | 121 | # PyBuilder 122 | target/ 123 | 124 | # Jupyter Notebook 125 | .ipynb_checkpoints 126 | 127 | # IPython 128 | profile_default/ 129 | ipython_config.py 130 | 131 | # pyenv 132 | .python-version 133 | 134 | # celery beat schedule file 135 | celerybeat-schedule 136 | 137 | # SageMath parsed files 138 | *.sage.py 139 | 140 | # Environments 141 | .env 142 | .venv 143 | env/ 144 | venv/ 145 | ENV/ 146 | env.bak/ 147 | venv.bak/ 148 | 149 | # Spyder project settings 150 | .spyderproject 151 | .spyproject 152 | 153 | # Rope project settings 154 | .ropeproject 155 | 156 | # mkdocs documentation 157 | /site 158 | 159 | # mypy 160 | .mypy_cache/ 161 | .dmypy.json 162 | dmypy.json 163 | 164 | # Pyre type checker 165 | .pyre/ 166 | 167 | ### Python Patch ### 168 | .venv/ 169 | 170 | ### Python.VirtualEnv Stack ### 171 | # Virtualenv 172 | # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ 173 | [Bb]in 174 | [Ii]nclude 175 | [Ll]ib 176 | [Ll]ib64 177 | [Ll]ocal 178 | [Ss]cripts 179 | pyvenv.cfg 180 | pip-selfcheck.json 181 | 182 | ### Windows ### 183 | # Windows thumbnail cache files 184 | Thumbs.db 185 | ehthumbs.db 186 | ehthumbs_vista.db 187 | 188 | # Dump file 189 | *.stackdump 190 | 191 | # Folder config file 192 | [Dd]esktop.ini 193 | 194 | # Recycle Bin used on file shares 195 | $RECYCLE.BIN/ 196 | 197 | # Windows Installer files 198 | *.cab 199 | *.msi 200 | *.msix 201 | *.msm 202 | *.msp 203 | 204 | # Windows shortcuts 205 | *.lnk 206 | 207 | # End of https://www.gitignore.io/api/linux,macos,python,windows 208 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - 3.6.6 5 | 6 | before_install: 7 | - git remote set-url origin https://Richienb:${github_token}@github.com/Richienb/git-files.git 8 | - git config --global user.email "richiebendall@gmail.com" 9 | - git config --global user.name "Richienb" 10 | 11 | install: 12 | - pip install -r requirements.txt 13 | - git clone https://github.com/github/gitignore.git 14 | - git clone https://github.com/alexkaratarakis/gitattributes.git 15 | 16 | before_script: 17 | - autopep8 -v -i -r -a -a -a generate.py 18 | - git add generate.py 19 | - git diff-index --quiet HEAD || git commit -m "Normalised generation file to follow the PEP8 specification [skip ci]" 20 | 21 | script: 22 | - python generate.py $PWD 23 | - git add -f $PWD/files/.gitignore $PWD/files/.gitattributes 24 | - git diff-index --quiet HEAD || git commit -m "Update Git Files [skip ci]" 25 | 26 | after_success: 27 | - pasteurize generate.py 28 | - git add generate.py 29 | - git diff-index --quiet HEAD || git commit -m "Added backwards compatibility [skip ci]" 30 | - git push origin HEAD:master 31 | 32 | notifications: 33 | email: false 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Richie Bendall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Generate Gitfiles 2 | generate: 3 | mkdir -p files 4 | git clone https://github.com/github/gitignore.git 5 | git clone https://github.com/alexkaratarakis/gitattributes.git 6 | python generate.py $PWD 7 | rm -rf gitignore 8 | rm -rf gitattributes 9 | 10 | # Pull Gitfiles from repository 11 | pull: 12 | git clone https://github.com/Richienb/git-files.git .git-files 13 | mv -f .git-files/files/.gitignore . 14 | mv -f .git-files/files/.gitattributes . 15 | rm -rf .git-files 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Files [![Travis CI Status](https://img.shields.io/travis/Richienb/git-files.svg?style=for-the-badge)](https://travis-ci.org/Richienb/git-files) 2 | 3 | A `.gitignore` and `.gitattributes` file containing ignore and attribute code for all programming languages, automatically updated daily. 4 | 5 | ## How to use 6 | 7 | Execute the commands while in the root directory of your Git repository 8 | 9 | - [From URL](#from-url) 10 | - [Using Makefile](#using-makefile) 11 | - [Using cURL](#using-curl) 12 | - [Using wGET](#using-wget) 13 | - [Using Traditional Git Cloning](#using-traditional-git-cloning) 14 | 15 | ### From URL: 16 | 17 | ``` 18 | https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitignore 19 | https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitattributes 20 | ``` 21 | 22 | ### Using Makefile: 23 | 24 | #### Pull from repository 25 | 26 | ```sh 27 | make pull 28 | ``` 29 | 30 | #### Generate the files 31 | 32 | ```sh 33 | make generate 34 | ``` 35 | 36 | ### Using cURL: 37 | 38 | ```sh 39 | $ curl -L -o .gitignore https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitignore 40 | $ curl -L -o .gitattributes https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitattributes 41 | ``` 42 | 43 | ### Using Wget: 44 | 45 | ```sh 46 | $ wget https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitignore 47 | $ wget https://raw.githubusercontent.com/Richienb/git-files/master/files/.gitattributes 48 | ``` 49 | 50 | ### Using traditional Git cloning: 51 | 52 | ```sh 53 | $ git clone https://github.com/Richienb/git-files.git 54 | $ mv -f git-files/files/.gitignore . 55 | $ mv -f git-files/files/.gitattributes . 56 | $ rm -rf git-files 57 | ``` 58 | 59 | ### Generate the files yourself 60 | 61 | ```sh 62 | mkdir -p files 63 | git clone https://github.com/github/gitignore.git 64 | git clone https://github.com/alexkaratarakis/gitattributes.git 65 | python generate.py $PWD 66 | rm -rf gitignore 67 | rm -rf gitattributes 68 | ``` 69 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: Richienb/jekyll-theme-richienb 2 | -------------------------------------------------------------------------------- /generate.py: -------------------------------------------------------------------------------- 1 | from sys import argv as args 2 | import glob 3 | import os 4 | 5 | # Set root directory 6 | try: 7 | rootdir = args[1] 8 | except BaseException: 9 | print("Please specify the directory you are running this script in.") 10 | 11 | # Clear files 12 | print("Clearing files...") 13 | open("files/.gitignore", "w").close() 14 | open("files/.gitattributes", "w").close() 15 | 16 | # Search for all gitignore files and append them to a list 17 | print("Searching for all .gitignore files...") 18 | ignorefile = [] 19 | os.chdir("{}/gitignore".format(rootdir)) 20 | for file in glob.glob("*.gitignore"): 21 | ignorefile.append(file) 22 | 23 | # Merge all the gitignore files into one file 24 | print("Merging all .gitignore files...") 25 | with open("{}/files/.gitignore".format(rootdir), "a+") as f: 26 | for i in enumerate(ignorefile): 27 | with open("{}/gitignore/{}".format(rootdir, i[1])) as ff: 28 | for ii in enumerate(ff.readlines()): 29 | f.write(str(ii[1])) 30 | 31 | # Search for all gitattributes files and append them to a list 32 | print("Searching for all .gitattributes files...") 33 | attributefile = [] 34 | os.chdir("{}/gitattributes".format(rootdir)) 35 | for file in glob.glob("*.gitattributes"): 36 | attributefile.append(file) 37 | 38 | # Merge all the gitattributes files into one file 39 | print("Merging all .gitattributes files...") 40 | with open("{}/files/.gitattributes".format(rootdir), "a+") as f: 41 | for i in enumerate(attributefile): 42 | with open("{}/gitattributes/{}".format(rootdir, i[1])) as ff: 43 | for ii in enumerate(ff.readlines()): 44 | f.write(str(ii[1])) 45 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | autopep8 2 | future 3 | --------------------------------------------------------------------------------