Global settings are written in ~/.gitconfig
$ git config --global user.email "Your email"
$ git config --global user.name "Your name"
$ git config --global color.ui auto
Note: color.ui is a set of 'color.branch, color.diff, color.interactive, color.status'
You can set different colors for each color.*
or use diff-highlight (I like this rather than color.ui)
Default packages of git include diff-highlight(https://github.com/git/git/tree/master/contrib/diff-highlight)
If you would like to always merge with non fast-forward (default is fast-forward)
$ git config --global merge.ff false
and if you would like to work with fast-forward when using pull (default is fast-forward)
$ git config --global alias.${name u like} 'pull --ff-only'
or
$ git config --global pull.rebase true
if you use Git2.x
$ git config --global pull.ff only
I like this configs :)
$ git config --global alias.stp 'stash'
$ git config --global alias.stq 'stash pop'
$ git config --global alias.stt 'status'
Note: 'status' and 'stash *' are starting with 'sta'
When I want to use 'git status', I often type 'git sta'
In this case, the completion system often suggest 'git stash' to me and then I cannot stop typing enter-key :(
$ git config --global alias.cl 'log'
$ git config --global alias.rl 'reflog'
I hate to spend long time with typing :(
Local settings are written in .git/config
$ cd /path/to/local/gitrepo/
you type the commands (which I wrote) which is removed --global
Hi gecko655.
That's right. i have a mistake.
Git cannot overwrite its default commands.
So, u should type 'git config --global alias.${name u like} 'pull --ff-only' or 'git config --global pull.rebase true' on Git 1.x
If u update git and get Git 2.x, 'git config --global pull.ff only' works well.
Git 2.x also don't allow overwriting its default commands, but it have a new parameter and value.
Thank u for pointing it out.