Chapter 1 Introduction
1.1 Prerequisites
We will start from the basics of version control and git and slowly build our knowledge and skills. While we will learn from the very basics, having familiarlity with command line will be helpful. First we will introduce the concepts, then practice them hands on.
We will have to ensure that our system is set up with the following.
- Internet connection
- Download and install software
- A text or word processing tool
There are a few things we are all prone to.
[insert picture same file multiple versions] [saving backup copy in case something doesn’t work] [deleting months of hard work by accident] [being overcautious and saving backups at multiple places]
These are “probably” good habits to form but they are not the most ideal.
Why use them? - collaboration - tracking changes
1.2 Version control and Git
This information fill later
1.3 Git
Created by Linus Torvalds, the same person who wrote the Linux kernel.
- The most popular version control system
- Many open source projects use git to track revision
- Distributed version control system (more on this later)
- Many hosted hosted services available
- Snapshot of file at the time of “save”
1.4 Installing Git
One way to install software by is by downloading and executing the executable from the source. The other way is using some sort of package manager.
Note: only install software that you trust!
1.4.1 Windows
Using windows package manager (chocolatey)
- Install chocolatey if not installed alerady
Run the following script using Powershell Admin access:
$> Get-ExecutionPolicyifrestrictedset it toBypassorAllSigned
$> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
- Install git using chocolatey
Run the following script on the same Powershell
$> choco install git
1.4.2 MacOs
Mac comes with default git install but it might be outdated. Check the version
$> git --version
Using homebrew package manager
Install Mac Package Manager (Homebrew)
$>/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”Install git using brew
$> brew install git
1.4.3 Linux
Skip Nobody in team using
- Check version of git to ensure install
$> git --verison
If software not found, check PATH variable
$> which git or where git
1.5 Git bash vs Git Gui
Git bash is a command line tool. We will have to write command on a terminal and execute the code to get the response. This is the native form of Git and is very versatile. It has as steep learning curve
Git bash helped me learn the command line
Git bash is useful even when not using Git. We can use git bash to move around the file system in Unix like command. This might not mean much at this point, but when we are using windows and unix interchangably, it will save us some time. Also, there is no graphical interfaces on servers so this is the only way to work “remotely”
Git gui is a visual interface to git. It is a great place to start to learn the basics of git and visualize the changes. However, the use will quickly plateau as our skills grow.
1.6 Configuring Git
Skip for now. Cover during collaboration
1.7 Hands on Exercise
Install Git on your machine and check the version