General stuff
2026
First, check you have git installed:
git --version
The first thing to understand is that git uses hashes (SHA-1 is the default). These are the things git uses to identify or record what we do (e.g., commits) our directories (in git these are called trees) and files (git calls these blobs).
High level commands (Porcelain)
git status
git add
git commit
git push
git pull
git log
Low level commands (plumbing)
git apply
git hash-object
git commit-tree
if you are feeling brave already check man git for the git manual.
But it will be a bit overwhelming right now so don't actually do that.
Configuration checks:
git config --get user.name
check that it is you.
to see where this stuff is actually stored: cat ~/.gitconfig
# This is Git's per-user configuration file.
[user]
email = ec627@sussex.ac.uk
name = EnricoCaprioglio
Set default branch:
git config --add --global init.defaultBranch main
Github's default is main (to name the main branch)
the last one counts in the list.
So for example you may have:
[init]
defaultBranch = master
defaultBranch = master
defaultBranch = main
Use git config --list to quickly view everything.
But the best thing is to just open the file .gitconfig and see what is up.
To open it use
nvim ~/.gitconfig
to just see what is in it:
cat ~/.gitconfig
That file is your global configuration.
You can add whatever you want here, using the structure:
[section]
key = value
and then read it from anywhere using:
git config secion.value
We'll see later the differences between system, global and local configs (it's nothing crazy, but for now this is enough).
The main takeaway about configuration is this:
[!tip] This is no black magic hidden somewhere crazy on your computer that you'll never find ever again once you set it up because the guide you were following told you to set it up that way. Just open that file, take a look at what is in there, and that is it.
Now, let's actually Get started
Referenced by
- Do you actually know git?
Let's start with some General stuff.