-
Notifications
You must be signed in to change notification settings - Fork 390
Set up Git #564
-
Why this task matters
Git is the version control tool that connects your local project folder to the shared repository on GitHub. It lets you clone the project, save your work, and sync changes with your team. This guide is focused solely on how to install and set up Git.
Note
If you are interested in a more thorough introduction to basic Git and Git collaboration check out the "Explore: Git" program. You can access this program by signing up on the Endless Platform and using this access code: A26EGT to join the Git program.
Steps (Windows)
- Download Git
Go to https://git-scm.com and download the Windows installer. - Install Git
- Run the installer.
- Accept the default recommended settings except:
- When prompted about "Adjusting the name of the initial branch...", choose to override the default and write in
main(instead ofmaster).
- When prompted about "Adjusting the name of the initial branch...", choose to override the default and write in
- Open Git Bash
- Method 1
- Right-click inside any folder where you’ll be working (e.g., Documents or Desktop).
- Select Open Git Bash Here from the menu. This opens a terminal window in that folder.
- Method 2
- Open Git Bash first, then navigate to your working directory/folder within Git using the "cd" command (change directory) followed by the name of the directory you want to go to
cd directory-name
- Check that Git was installed correctly
- Type:
git --version - You should see something like:
git version 2.42.0
- Type:
- Tell Git who you are (use the name and email associated with your GitHub account)
-
In Terminal, type:
git config --global user.name "Your Name"Press Return/Enter.
-
Then type:
git config --global user.email "you@example.com"Press Return/Enter.
-
This info gets attached to your commits so your team knows who made which changes.
-
Lastly, type this command so Git remembers your GitHub login and you’re not asked every time you send changes to GitHub.
git config --global credential.helper manager-core
-
✅ Done! Git is installed, configured, and ready to connect to GitHub.
Video
Steps (macOS)
-
Make sure you’re an Admin
- Open System Settings → Users & Groups.
- Check your account. If it doesn’t say Admin, ask someone with admin access to help.
-
Install Homebrew (this also installs Git)
- Go to https://brew.sh.
- Copy the install command shown on the page.
- Open Terminal (search in Launchpad if it’s not on your Dock).
- Paste the command into Terminal and press Return/Enter.
- Enter your Mac password if prompted (it won’t show letters or dots as you type, that’s normal).
- Wait for it to finish. This can take several minutes.
-
Install Git LFS
- In Terminal, type:
brew install git-lfs
- Then type:
git lfs install
- You should see:
Git LFS initialized.
- In Terminal, type:
-
Install Git Credential Manager
- In Terminal, type:
brew install --cask git-credential-manager
- In Terminal, type:
-
Check that Git is working
- In Terminal, type:
git --version
- You should see something like:
git version 2.xx.x
- In Terminal, type:
-
Tell Git who you are (be sure to use the email associated with your GitHub account)
-
In Terminal, type:
git config --global user.name "Your Name"Press Return/Enter.
-
Then type:
git config --global user.email "you@example.com"Press Return/Enter.
-
This info gets attached to your commits so your team knows who made which changes.
-
The first time you try to send your changes up to GitHub, a window will pop up.
-
Click "Sign in with your browser."
-
Log into GitHub. When it says "Authentication Succeeded," you’re done.
-
Steps (Linux)
All Linux distributions are different, so here we just outline the general steps required.
You can choose to use Homebrew to install all the necessary components on any Linux distribution. Follow the macOS steps above, starting at step 2.
Otherwise, if you want to install using your distribution's package manager, read on!
Note
If you are using an immutable Linux distribution such as Endless OS, Fedora Silverblue, Bazzite, etc., you can either use Homebrew, as above, or use toolbx and follow the steps below inside a toolbx.
1. Check if Git is already installed
Many Linux distributions pre-install Git. Open a Terminal window and run:
git --version
- If this shows a message like "bash: git: command not found", continue to step 2.
- If this shows a message like "git version 2.39.5", skip to step 3.
2. Install Git
Most Linux distributions have a git package. Install it using your distribution's package manager, such as apt or dnf. For example:
# Debian/Ubuntu/similar systems sudo apt install git # Fedora/Red Hat/similar systems sudo dnf install git
3. Install Git LFS
Most Linux distributions have a git-lfs package, too. Install it using your distribution's package manager. For example:
# Debian/Ubuntu/similar systems sudo apt install git-lfs # Fedora/Red Hat/similar systems sudo dnf install git-lfs
If your distribution does not have a git-lfs package, follow these instructions.
4. Tell Git who you are
Note
Be sure to use the email associated with your GitHub account!
In Terminal, type:
git config --global user.name "Your Name"Press Return/Enter. Then type:
git config --global user.email "you@example.com"5. Install Git Credential Manager
Note
If you prefer, you can use an SSH key to connect to GitHub, and skip steps 5 and 6.
- Follow these instructions to install Git Credential Manager
- Configure it to store secrets with Secret Service:
git config --global credential.credentialStore secretservice
Press Return/Enter.
6. Log in to GitHub
The first time you try to send your changes up to GitHub, a window will pop up. Click "Sign in with your browser." Log into GitHub. When it says "Authentication Succeeded," you’re done.
✅ Done! Git is installed, configured, and ready to connect to GitHub.
Beta Was this translation helpful? Give feedback.