Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore across all branches?

Tags:

git

gitignore

Hey I'm trying to get into git, as an emacs user first thing to do is to make sure the ~ and #*# files are ignored by git. Documentation talks about .gitignore which I've been using. However couple of questions remain:

  • gitignore is now checked in and part of a branch. Should .gitignore be checked in and if so, how can i make it easy available across all branches in my repository?
  • is there a way to use the gitignore with git config so gitignore stays constant over all my repos?
  • How can I deal with emacs lock files as #*# is treated as a comment?

I'm on mac ox snow leopard. regards, Jeroen

like image 719
dr jerry Avatar asked Feb 09 '11 12:02

dr jerry


1 Answers

Add this to your $HOME/.gitconfig ;

[core]
    excludesfile = /path/to/your/local/.gitignore

Then it'll be locally available on all your git repositories.

like image 145
ismail Avatar answered Nov 15 '22 22:11

ismail