# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # | |
############ | |
# it's better to unpack these files and commit the raw source | |
# git has its own built in compression methods | |
*.7z | |
*.dmg | |
*.gz | |
*.iso | |
*.jar | |
*.rar | |
*.tar | |
*.zip | |
# Logs and databases # | |
###################### | |
*.log | |
*.sql | |
*.sqlite | |
# OS generated files # | |
###################### | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes | |
ehthumbs.db | |
Thumbs.db |
This comment has been minimized.
This comment has been minimized.
Thanks, Octocat! |
This comment has been minimized.
This comment has been minimized.
*.pyc would be a good addition here. |
This comment has been minimized.
This comment has been minimized.
So convenient! Thanks Octocat! |
This comment has been minimized.
This comment has been minimized.
Useful stuff, thanks! |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
even *.bak & *.swp as well can be added |
This comment has been minimized.
This comment has been minimized.
Of course GitHub would give their logo an account. Awesome |
This comment has been minimized.
This comment has been minimized.
It's good, thanks. But how to ignore some directories, such as target, out, production? |
This comment has been minimized.
This comment has been minimized.
Great resource - many thanks for sharing. |
This comment has been minimized.
This comment has been minimized.
Some examples with directories per https://gist.github.com/ThomsonTang suggestion would help round out this already excellent tip |
This comment has been minimized.
This comment has been minimized.
Thank you for this great contribution! |
This comment has been minimized.
This comment has been minimized.
Thanks used this a number of times on projects |
This comment has been minimized.
This comment has been minimized.
I think .dll files are important if you're developing with .NET. Also, you could include .ai, .eps, and .psd on it. Thanks, for the great snippet. |
This comment has been minimized.
This comment has been minimized.
nice! you should add sass-cache folder too ;) |
This comment has been minimized.
This comment has been minimized.
Awesome. |
This comment has been minimized.
This comment has been minimized.
awesome document. thanks. |
This comment has been minimized.
This comment has been minimized.
Hi, I added some IDE files (of NetBeans, Eclipse and Zend Studio) to ignore. Look at: |
This comment has been minimized.
This comment has been minimized.
Surely, *~ and *# for emacs users |
This comment has been minimized.
This comment has been minimized.
Very helpful. Thanks |
This comment has been minimized.
This comment has been minimized.
How I can ignore a specific directory ? |
This comment has been minimized.
This comment has been minimized.
very helpful :) |
This comment has been minimized.
This comment has been minimized.
Thanks Octocat ! |
This comment has been minimized.
This comment has been minimized.
tags |
This comment has been minimized.
This comment has been minimized.
Helpful |
This comment has been minimized.
This comment has been minimized.
.iml :) |
This comment has been minimized.
This comment has been minimized.
Add these to exclude media extensions: Images*.jpg Video*.wmv Audio*.wav Fonts*.eot |
This comment has been minimized.
This comment has been minimized.
.idea |
This comment has been minimized.
This comment has been minimized.
This gist is pretty much defunct by https://github.com/github/gitignore |
This comment has been minimized.
This comment has been minimized.
.orig files generated by git diff |
This comment has been minimized.
This comment has been minimized.
I love .gitignore thank you |
This comment has been minimized.
This comment has been minimized.
Some windows files too;
|
This comment has been minimized.
This comment has been minimized.
To ignore backup files generated by text editor anywhere in the subdirectory
To ignore IDE (eclipse / intellij) related files
|
This comment has been minimized.
This comment has been minimized.
And What about Iconr? |
This comment has been minimized.
This comment has been minimized.
This is very helpful. Thanks guys |
This comment has been minimized.
This comment has been minimized.
@arulrajnet @cptstarling it is not recommended to ignore entire .idea directory. Instead we should add only the two lines below to local .gitignore file:
This way all good project configuration (for example Code Style, namespaces mapping, etc) will be shared among all team. |
This comment has been minimized.
This comment has been minimized.
Good! Now I can git on with my work ^^ |
This comment has been minimized.
This comment has been minimized.
Thanks that really helped |
This comment has been minimized.
This comment has been minimized.
What if I want to ignore all .txt files, but one? For example all the txt files out, but keep important.txt ? |
This comment has been minimized.
This comment has been minimized.
*.log isn't working for me. I have the logs 'server.log', 'connected.log', and 'visitorcount.log' in a folder named 'logs', and GitHub Desktop keeps asking me to commit the files whenever they are modified. I'm using Notepad to add these updates and have rebooted GitHub Desktop. Is there any weird technical feature that I am missing? |
This comment has been minimized.
This comment has been minimized.
for vim users
|
This comment has been minimized.
This comment has been minimized.
Thanks, add to my file, and add npm install modules directory |
This comment has been minimized.
This comment has been minimized.
Thanks man. |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Wonderful, yo~ |
This comment has been minimized.
This comment has been minimized.
for vim |
This comment has been minimized.
This comment has been minimized.
Here's a more robust version of the **/*~
**/*.bak
**/*.sw[abcdefghijklmnop] |
This comment has been minimized.
This comment has been minimized.
Thank you . Quite a useful example. |
This comment has been minimized.
This comment has been minimized.
It is strange that no one mentioned http://www.gitignore.io - web ui to https://github.com/github/gitignore |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
@hppavilion1 you should add **/ prefix. It'll include all subfolders as well. ex:
|
This comment has been minimized.
This comment has been minimized.
Should |
This comment has been minimized.
This comment has been minimized.
*.png |
This comment has been minimized.
This comment has been minimized.
does adding .gitignore inside the .gitignore file affect anything generally? |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
And |
This comment has been minimized.
This comment has been minimized.
And I agree with @ScottyMJacobson, |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
vim swapfiles (*.swp) should be added as those do not belong into a repository |
This comment has been minimized.
This comment has been minimized.
thanks so much |
This comment has been minimized.
This comment has been minimized.
Great resources |
This comment has been minimized.
This comment has been minimized.
thanks , nice work!! |
This comment has been minimized.
This comment has been minimized.
Very useful! |
This comment has been minimized.
This comment has been minimized.
Neat! Thanks. |
This comment has been minimized.
This comment has been minimized.
Huge help, thanks. |
This comment has been minimized.
This comment has been minimized.
Thank you. |
This comment has been minimized.
This comment has been minimized.
Should be located in |
This comment has been minimized.
This comment has been minimized.
Here is a project I'm maintaining for gitignore templates - https://www.gitignore.io |
This comment has been minimized.
This comment has been minimized.
I'd add *.msi to my package section. |
This comment has been minimized.
This comment has been minimized.
Might want to add this specific file example (keys.js) into your .gitignore file if you are using API keys to keep that info private and not copied. |
This comment has been minimized.
This comment has been minimized.
Thanks a lot Octocat! |
This comment has been minimized.
This comment has been minimized.
Thank you for your helpful work! |
This comment has been minimized.
This comment has been minimized.
Really handy, thanks! |
This comment has been minimized.
This comment has been minimized.
Thank you for this great contribution! i use it every time |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
.vscode |
This comment has been minimized.
This comment has been minimized.
++++ |
This comment has been minimized.
This comment has been minimized.
where to put this in case of GitHub Desctop App on windows system? |
This comment has been minimized.
This comment has been minimized.
.pyc also |
This comment has been minimized.
This comment has been minimized.
Very useful and handy. Thanks a lot |
This comment has been minimized.
This comment has been minimized.
This is so useful!! Thank you |
This comment has been minimized.
This comment has been minimized.
A note on .sqlite: |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
well done |
This comment has been minimized.
This comment has been minimized.
Gittin' jiggy wid it. |
This comment has been minimized.
This comment has been minimized.
We should also add target folder in .gitignore , which is generated by maven as build outcome along with packaged files, as: |
This comment has been minimized.
This comment has been minimized.
Global git ignores seem to be quite improper when a person is using git-annex. I first experienced this a couple of years ago: umeboshi2/dotfiles@49292a1 Today, while trying to update the git-annex repo for http://ifarchive.org I found a few more. Please add some language that qualifiy the suggestions from github to allow for the addition of certain "ignores" that may need to be tracked above git, yet still be under the constraints of the ignore file. In all honesty, the suggestions from this gist, with respect to the config being global, and also the use of git-annex, has eliminated many of your suggestions. Even my opinion on *~ wasn't met by http://ifarchive.org. My ignore file is here: https://github.com/umeboshi2/dotfiles/blob/master/gitignore_global Please understand that I was actually surprised by a "filename~" existing on the mirror and had to really .think about the ignore file. That was not your suggestion, but I was surprised anyway. My purpose for the comment is to encourage github to provide some sort of "disclaimer" that these files may not need to be ignored. It's very possible that git-annex may want to "ignore" the global ignores and have it's own global ignore file and not respect the global git ignore config. I will try to bring that point across to Mr. Hess if able. |
This comment has been minimized.
This comment has been minimized.
GOOD |
This comment has been minimized.
This comment has been minimized.
Please also add *.apk to it, thanks. |
This comment has been minimized.
This comment has been minimized.
Also remember to add
Mac OS seems to have no problems with filenames ending with a period, but Windows does, and GIT on Windows will not interact with a Repo which has any files with this hanging period. |
This comment has been minimized.
This comment has been minimized.
Thanks, Bud! |
This comment has been minimized.
This comment has been minimized.
thanks! |
This comment has been minimized.
This comment has been minimized.
Very helpful; thanks! |
This comment has been minimized.
This comment has been minimized.
Thank you for this, my friend! It will surely complete my .gitignore file |
This comment has been minimized.
This comment has been minimized.
Good, thanks |
This comment has been minimized.
This comment has been minimized.
Thanks Octocat you hero |
This comment has been minimized.
This comment has been minimized.
I agree with @ScottyMJacobson and @giovannipds that *.sql should not be ignored. I've seen them used both for initial database setups and for storing complex queries. |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
tags should be a good addition here |
This comment has been minimized.
This comment has been minimized.
+1 on removing See: https://edgeguides.rubyonrails.org/active_record_migrations.html#types-of-schema-dumps |
This comment has been minimized.
This comment has been minimized.
Thanks ! |
This comment has been minimized.
This comment has been minimized.
Thanks for published |
This comment has been minimized.
This comment has been minimized.
Most excellent. Thank you. |
This comment has been minimized.
This comment has been minimized.
Can we ignore web.Config file using gitignore file |
This comment has been minimized.
This comment has been minimized.
Awesome! |
This comment has been minimized.
This comment has been minimized.
Helpful stuff, thanks! |
This comment has been minimized.
This comment has been minimized.
In case you have a private key: |
This comment has been minimized.
This comment has been minimized.
Great! Thanks ;) |
This comment has been minimized.
This comment has been minimized.
xcuserdata |
This comment has been minimized.
This comment has been minimized.
Nice, geezer. |
This comment has been minimized.
This comment has been minimized.
For sublime users: |
This comment has been minimized.
This comment has been minimized.
Thanks for this, unfortunately *.exe doesn't exclude exe files. |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
How about cloud secrets keys? Is there a way to ignore this .pem etc files. |
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
+100 |
This comment has been minimized.
This comment has been minimized.
Use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5 years later and this link is still KING!! |
This comment has been minimized.
This comment has been minimized.
Gracias Amiguito...!!! |
This comment has been minimized.
This comment has been minimized.
Thanks a lot. |
This comment has been minimized.
This comment has been minimized.
THANKSSS octocat !!! |
This comment has been minimized.
This comment has been minimized.
Thank you very much! |
This comment has been minimized.
This comment has been minimized.
How can we actually ignore the .gitignore file from being added to the zip which can be downloaded? |
This comment has been minimized.
This comment has been minimized.
great! thank you |
This comment has been minimized.
This comment has been minimized.
thank you so much, very useful |
This comment has been minimized.
This comment has been minimized.
I finally git it |
This comment has been minimized.
This comment has been minimized.
What's the syntax for ignoring everything in a directory? I thought it was just directory\names\here* but in the repository for the Minecraft modpack I'm working on, git is still picking up Minecraft crash reports when I do crash-reports\*. Not the end of the world to track them but considering I'm making/version-controlling a modpack not a mod, they also aren't essential. |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
Thank you so much!! |
This comment has been minimized.
This comment has been minimized.
Thanks, Very Helpful |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nothing found. just uploaded a kiddin' :3 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Useful!! |
This comment has been minimized.
GIT with it