Skip to content

Instantly share code, notes, and snippets.

@scarnago
Last active September 23, 2015 04:13
Show Gist options
  • Save scarnago/dfe740454cf226a43151 to your computer and use it in GitHub Desktop.
Save scarnago/dfe740454cf226a43151 to your computer and use it in GitHub Desktop.
How to create a file .gitignore global

Configure Git with a global gitignore file

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"
git config --global user.email "Your Email"

ssh-keygen -t rsa -C "Your Email"
cat ~/.ssh/id_rsa.pub

Open id_rsa.pub with any text editor and copy the public key. Login into your Github account and go to Settings > SSH Keys. Clic on Add SSH Key and paste your public key. Open a terminal and type

Type the password you use when create the id_rsa.pub.

Content for the ~/.gitignore_global

# OS Generated Files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.git
desktop.ini
$RECYCLE.BIN/

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# Packages #
############
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.bak
*.psd
*.ai
*.eps
*.tpl.php

# Compiled Source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
node_modules/
.sass-cache/
npm-debug.lo

# IDE and Text Editors #
########################

# Vim
.*.sw[a-z]
*.un~
Session.vim
.netrwhist
 
# Eclipse
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
.externalToolBuilders/
*.launch
.buildpath
 
# PhpStorm
.idea/
 
# TextMate
*.tmproj
*.tmproject
tmtags
 
# Sublime Text
/*.sublime-project
*.sublime-workspace
 
# Netbeans
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment