git config --global user.name "Firstname Lastname"
git config --global user.email "your.email@example.org"
By default, Git runs the git fetch
followed by the git merge
command if you use the git pull
command. You can configure git to use git rebase
instead of git merge
for the pull command via the following setting:
git config --global branch.autosetuprebase always
git config --global color.ui auto
On Windows systems you can tell Git to convert line endings during a checkout to CRLF and to convert them back to LF during commit:
git config --global core.autocrlf true
On Linux and Mac you can tell Git to convert CRLF to LF with the following setting:
git config --global core.autocrlf input
Create a .gitignore_global
file (you can choose a name you find easier to understand) in your User folder (C:\Users\{your user name})
for most Windows PCs, Users/{username}
on a Linux/Unix based machine.
Run in your Bash terminal or Windows console (command prompt), adapt the file name if you used a different one:
git config --global core.excludesfile ~/.gitignore_global
Oh My ZSH already has most of them defined, just check them out by running alias
in your terminal.
git config --global alias.co checkout #=> Run `git co` => the same as _git checkout_
git config --global alias.st status #=> Run `git st` => the same as _git status_
git config --global alias.br branch #=> Run git br => the same as _git branch_
git config --global alias.cob checkout -b #=> Run git cob => the same as _git checkout -b_
git config --global alias.hist log --abbrev-commit --pretty=oneline
Run git hist
to see some abbreviated commit history.
Example:
git hist -5 #=> will display a nice history for the last 5 commits
git config --global --list
You can find more about it in Git docs.