Git Snippets
Table of Contents
Table of Contents
git config --global user.name "FirstName LastName"
git config --global user.email "mail@example.com"
# To verify the global configuration, run:
git config --list
# Locally (per repo)
git config user.name "FirstName LastName"
git config user.email "mail@example.com"
# To verify the local configuration, run:
cat .git/config
# To display the list of aliases you currently have, run:
git config --get-regexp alias
# To remove an alias, run:
git config --global --unset alias.aliasName
#––––––––––––––––––––––––––––––––––––––––––
# Alias 1 (Git status)
#
# Usage: git st
git config --global alias.st status
#––––––––––––––––––––––––––––––––––––––––––
# Alias 2 (Stage all changes and commit)
#
# Usage: git adc -m "Commit message"
git config --global alias.adc '!git add -A && git commit'
#––––––––––––––––––––––––––––––––––––––––––
# Alias 3 (Show history)
#
# Usage example: git lol
# Usage example: git lol -5
git config --global alias.lol 'log --graph --decorate --pretty=oneline --abbrev-commit'