Useful Git global config and ignore rules
📅
Fri, Apr 28, 2017
⏱️
2-minute read
I am working with git
every single day, from different machines and accounts. And all these hosts have the same global git configuration. I sync it using tiny bash script.
~/.gitconfig
I have user-specific configuration located in ~/.gitconfig
. Common exclude rules, ignoring temporary files, IDE files, logs, binary files, etc. You don’t want to see them in repository, right?
|
|
Shortcuts for git clone
:
|
|
For example:
|
|
Then I have colors setup and diff tool setup:
|
|
And some useful aliases:
|
|
git l
output:
|
|
How to sync these configuration between machines
I have to sync 2 files: ~/.gitconfig
, ~/.gitignore
. I have placed an apply.sh
script that will copy these files from the gitbootstrap repository.
|
|