Version control enables developers to record changes made to scripts, files, and folders while developing applications. After saving her work, the developer can then revert back to previous versions if and when the need arises. While developing applications, the developer, might have a compelling reason to revert to an older version of her code. This is where version control comes to the rescue.
Check to see if you have git installed.
$ git --version
git version 2.17.1 (Apple Git-112)
If you don't already have homebrew installed run the line below to install it.
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
5.If you're curious, learn more about the command
$ brew doctor --help
6.Check your system for potential problems.
$ brew doctor
$ brew install git
If you're on a Linux based system, e.g. Ubuntu or Debian you can install Git using the following lines below.
1.Check to see if you have Git installed already.
$ git --version
2.Update your system
$ sudo apt-get update
$ sudo apt-get install git
Finally connect your Gihub account to your computer by running the following lines. This applies to all systems
1.Add your username
$ git config --global user.name "YOUR NAME"
2.Add your email address
$ git config --global user.email "YOUR@EMAIL.com"
3.Generate your SSH Key
$ ssh-keygen -t rsa -C "YOUR@EMAIL.com"
4.Run the command below, then copy the output to your clipboard.
$ cat ~/.ssh/id_rsa.pub
5.Next, visit Github and add your
SSH Key by pasting what you copied from the previous command above. Use the link provided below to get to the Github SSH Keys page.
6.Go back to your terminal and check to see if everything is set up correctly by running the command below.
$ ssh -T email@example.com
7.If all went well, you should see the following output shown below in your terminal.
$ Hi YourGithubUserName! You've successfully authenticated, but GitHub does not provide shell access.