git start configuration

by alex, 2014-06-01

Git is powerful distributed version control system, which is used in many projects. When you setting up a new computer and has to make an initial configuration, this cheatsheet might be useful.

  1. git config --global "Oleksii Chernomaz"
  2. git config --global
  4. git config --global checkout
  5. git config --global commit
  6. git config --global status
  7. git config --global branch
  8. git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'
  9. git config --global core.editor vim
  10. git config --global color.ui true
  11. git config --global core.excludesfile ~/.gitignore
git config --global "Oleksii Chernomaz"
git config --global

git config --global checkout
git config --global commit
git config --global status
git config --global branch
git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'
git config --global core.editor vim
git config --global color.ui true
git config --global core.excludesfile ~/.gitignore

Do not forget to create your «.gitignore» in home directory file and add there all caches, ide files, OS cache files, etc.

Never keep in your project’s «.gitignore» file, things, which are not related to the project at all. For example temporary files from your IDE or OS. For this purpose you have a global .gitignore file.

Many times I saw there DS_Store, .idea, etc. It should NOT be there, never. Project files must contain only things, which are related to your project. If your project generates cache, log or temp files during working cycle, in this case use can use project’s gitignore file to avoid everyone from committing them.

For example, developer on windows workstation does not care, that OS X creates «.DS_Store» files. Its not relevant for his working machine, so why do you think it’s useful to push this «garbage» into the «.gitignore» file of the project? It’s a responsibility of developer to set up his working machine in the way, when all those temporary files, logs or caches from OS, IDE would never bother him.

example of global ~/.gitignore file

  1. *DS_Store
  2. .idea/
  3. .vagrant
  4. *.php~
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterEmail this to someoneShare on LinkedIn

No Comments

Leave a Reply

Your email address will not be published Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" extra="">


18 − 5 =