-
Notifications
You must be signed in to change notification settings - Fork 1
Week 0: Introduction to Git and GitHub
GitHub is a web-based cloud service to host your source code. Think of it like google drive, but for your code base. Each project on your GitHub is called a "repository".
Git is a free and open source version control system designed to handle everything from small to very large projects with speed and efficiency. Git lets you interact with services like GitHub, Gitlab etc. It becomes very useful when working in larger teams, it makes every developer's life easier and hence is a very important skill to know about. Git has some commands that you can utilise to efficiently work with Github, we will get to those later, lets first install git on your system.
- Download Git from Git for Windows and install it
Most Linux distributions come with git pre-installed, try running: git --version
to verify if it exists on your system.
An output like this implies that git is installed correctly. If you get an error, or if the version seems too old, continue with the installation described below
Determine which Linux distribution your system is based on. See List of Linux distributions – Wikipedia for a list of different Linux Distributions. Most Linux systems – including Ubuntu – are Debian-based.
Open a terminal window. Copy & paste the following into the terminal window and hit Return
. You may be prompted to enter your password.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
You can use Git now.
sudo dnf update
sudo dnf upgrade
sudo dnf install git
Step 1 – Install Homebrew
Homebrew simplifies the installation of software on the Mac OS X operating system.
Copy & paste the following into the terminal window and hit Return
.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
You will be offered to install the Command Line Developer Tools from Apple. Confirm by clicking Install. After the installation finished, continue installing Homebrew by hitting Return
again.
Copy & paste the following into the terminal window and hit Return
.
brew install git
You can use Git now.
If running git --version
returns an output like this, congratulations you have successfully installed git!
Here is a git commands cheat sheet for your reference