Is it possible to have a custom .gitignore? Read only access?

Blankman picture Blankman · May 24, 2011 · Viewed 15.6k times · Source

I am working in a team environment, and there is already a .gitignore file.

I want to add more items to the .gitignore file, but I don't want to check this file in either. It is possible to set custom ignore files which only apply to me?

Also, I want to give someone read only access to a private git repository on our server, if I add their SSH key to our server they will get full access like everyone else. How can I limit it to read-only, no commits allowed.

Answer

Fred Foo picture Fred Foo · May 24, 2011
  1. Put your private ignore rules in .git/info/exclude. See gitignore(5).
  2. For read-only access, use git-daemon, a web server, or Gitosis, or Gitolite.