Get some help for using git
02 Dec 2018 (last updated on 09 Oct 2020) - written by Hardy Scheel
Table of content
Useful CLI Commands
Viewing Commit History
git log --all --decorate --oneline --graph
Tutorials
Get to know git as a version control system.
- Pro Git e-book in various languages
- Official Git introduction tutorial
- A guided tour through Git fundamentals
- Git for GitHub handbook
Cheat Sheets
Get a quick overview of relevant git commands for your daily work.
- GitHub’s Git CLI Cheat Sheets - overview
- GitHub’s Git CLI Cheat Sheets
- GitHub’s Git CLI Cheat Sheets - as a PDF
- GitHub’s Git CLI Cheat Sheets - German
Advanced Git usage
- GitHub Cheat Sheet - Powerful tips and use cases
- A Visual Git Reference - Graphical in-depth Git knowledge
- A Visual Git Reference - German
- Visualizing Git Concepts with D3
Solving Problems
Helpful Tools
- Git Kraken GUI - Best graphical tool for managing commits & merge conflicts
- Sublime Merge - Very good graphical git merge tool
FAQ
Change the user for a repository
Git uses a hierarchical configuration of multiple levels. Settings in higher levels override values in lower levels. Lower levels inherit from higher levels (eg. local inherits from global).
- system - Settings for all users of the system are stored in git installation folder:
your-git-installation-folder/etc/gitconfig
- global - Settings for the current user are stored locally in your user home directory:
~/.gitconfig
- local - The current repository settings are stored locally in the repository directory:
.git/config
You can configure an individual repository to use a specific user which overrides the global configuration. From the root directory of the repository, run the following on command line:
$ git config user.name "your name"
$ git config user.email your@email.com
The default user for all repositories is configured in the global configuration file in your home directory ~/.gitconfig
. You can also run the following from command line:
$ git config --global user.name "your name"
$ git config --global user.email your@email.com