Git

What is Git?

Git is a popular version control system.

It was created by Linus Torvalds in 2005, and has been maintained by Junio Hamano since then.

It is used for:

Key Git Concepts

Working with Git

Note

Note: Most Git actions (like staging, committing, and viewing history) happen on your own computer.

Only Push and Pull interact with remote servers like GitHub, GitLab, or Bitbucket to upload or download changes.

Git Install

Linux

Arch Linux

sudo pacman -S git

Debian

sudo apt install git

Fedora

sudo dnf install git

Mac OS

brew install git

Git Config

Configuration Levels

There are three levels of configuration:

The order of precedence is:

The reason to use the different levels is that you can set different values for different users or repositories.

This can be used for example to set different default branches for different repositories and users.

git config --global user.name "Bernardus Ivan Hertanto"
git config --global user.email "[email protected]"
git config  --global core.editor nvim

Get Started with Git

cd myproject
git init