GIT BASICS
NEED OF VERSION CONTROL & WHAT IT IS?
Need of Version control:
Work in a team, probably on particular components
Integrate your code together.
Make copies of your files in case something you lose them.
What is Version control:
Version control is the management of changes to documents, primarily computer programs.
Also known as revision control or source control.
Examples: git, mercurial, subversion
Benefits of Version control:
Makes working in a team easy!
1. Code without interference.
2. Go back to a previous version (iOS 10 anyone?)
3. Integrate code of multiple developer’s easily.
4. Know who did what, when.
Keep your code secure.
WHAT IS GIT?
Git is a distributed version control system. A version control system
is a tool that allows us to manage changes made to blobs.
It is a tool that allows you to track your code history. Allows you to
peek into the past and see what a code looks like at any given point
of development.
An important tool to collaborate with other fellow developers. As
developers you can’t collaborate efficiently by sending pieces of
code in a zip file, or sharing it over the folder.
Source of truth, it is important to track down developers who made
the changes and what changes are done.
INSTALLING GIT?
You need Git installed on your system, and you can access it in a
UNIX Terminal, either the Terminal on the Mac or Git Bash on
Windows.
Download Git from the following link:
https://git-scm.com/downloads
BASIC GIT MODEL LOCALLY
WHAT IS GIT HUB
It’s a hosting medium/website for your Git repositories
Offers powerful collaborative abilities
A good indicator of what you code/how much you code/quality of
your code
Alice Bob
Joe
Who replaced the files? When ?
COLLABORATION WITH GITHUB
Remote
Repo
Master
C1
Alice Bob
C2
COLLABORATE
Remote
Repo
git clone git clone
Master Master Master
C1 C1 C1
Alice Bob
C2 C2 C2
COLLABORATE
Remote
Repo
Master Master Master
C1 C1 C1
Alice Bob
C2 C2 C2
CA git add CB git add
git commit git commit
COLLABORATE
Remote
Repo
Master Master Master
C1 git push C1 C1
Alice Bob
C2 C2 C2
CA C3 CB
COLLABORATE
Remote
Repo
Master Master Master
C1 C1 git fetch C1
Alice Bob
C2 C2 C2 C3
CA C3 CB
COLLABORATE
Remote
Repo
Master Master Master
C1 C1 git merge C1
Alice Bob
C2 C2 C2
CA C3
C3
CB
COLLABORATE
Remote
Repo
Master Master Master
C1 C1 git push C1
Alice Bob
C2 C2 C2
CA C3 C3
CB
CB
COLLABORATE
Remote
Repo
Master Master Master
C1 git pull C1 C1
Alice Bob
C2 C2 C2
CA C3 C3
CB CB CB
GIT BRANCHING STRATEGY