Git is a version control software that allows developers to develop the same project. It allows developers to track the changes to a set of files which is called “repository” or “repo”. Install Git.
# install git via winget on windows
winget install --id Git.Git -e --source winget
# install git via homebrew on mac
brew install git
# install git via macport on mac
sudo port install git
After installing Git, I configure my username and email as Git attaches the information to the commits:
git config --global user.name "my name"
git config --global user.email "my email"
My name can be found as below:
SSH keys are used to establish a secure connection between my computer and the Git server. Here’s how to set them up:
ssh-keygen
and press Enter to create a new SSH key.After generating the SSH keys, I will have a private key (id_ed25519
) and a public key (usually id_ed25519.pub
).
Locate public SSH key file and open it with a text editor to copy its contents. In my case, the file is id_ed25519.pub
. Go to Git server (e.g., GitHub, Bitbucket) and find the section where I can add SSH keys (usually in the account settings).
My Laptop
.Add SSH key
to add the key to the Git server.3.Paste public key into the appropriate area and save it.
To start working on an existing project. The current repository needed to be cloned:
git clone https://gitlab.fabcloud.org/academany/fabacademy/2025/labs/chaihuo/students/chonkit-kuok.git
Here are some basic Git commands I'll use:
# Check the status of your files (modified, added, etc.)
git status
# Add all changes to the staging area
git add .
# Commit your changes with a message
git commit -m "Your commit message"
# Push your changes to the remote repository
git push
# Pull the latest changes from the remote repository
git pull