git
Block 1.1: What is git?
Background: https://unsplash.com/photos/842ofHC6MaI
Git can be used via both a CLI and GUI.
Command Line Interface (CLI)
Graphical User Interface (GUI)
git
git
itself is a CLI program*: These programs have a different main purpose, but also offer the option of using git via their GUI.
git
CLIgit
cheatsheet to follow alonggit config
⚙️Run the following commands in your terminal to correctly configure git on your computer.
git config
⚙️For Linux/Mac:
For Windows:
Why? Windows saves linebreaks (enter) differently then Linux/Mac does 🤷♂️
Background: Warnerbros, via Digital Spy
git status
A project in git is called a repository (or repo for short) and it always corresponds to a directory on your machine.
To see the current status of a git repository you can run the status
command.
git status
We get an error here, because you first need to initialize a git repository.
git init
Before we can use git in a project we first have to initialize it in the directory of the project. This is done via the init
command.
git init
# Initialized empty Git repository in /Users/jan/Dev/temp/test/.git/
git status
# On branch main
# No commits yet
# nothing to commit (create/copy files and use "git add" to track)
With git init
we turn the directory into a repository.
git init
to initialize a new repository theregit clone
Alternatively, we can download a repository from the internet using the clone
command. This will create a new repository on our machine and fill it with the remote repository’s contents.
Any Questions?