Kosmas Pouianou, Kostas Minaidis
(Instructors at Social Hackers Academy)
Version 0.1.0 | 26/04/2018
Create Things
Save Things
Edit Things
Save the Things Again
No control over our changes. They are permanent.
We cannot revert to a previous state.
There is no descriptive history of the changes.
It is almost impossible to work collaboratively.
A system that records changes to a file or set of files
over time so that you can recall specific versions later.
A system that enables collaboration:
A Team of people working on one Project, on the same files.
It allows you to:
Using a VCS also generally means that
if you screw things up or lose files, you can easily recover.
Version History
header: #ff69b4
footer: #185d2c
header: #457aa5, footer: #457aa5
header: #a57d45
header: #457aa5, footer: #ad2222
Create Things
Save Things
Edit Things
Save the Things Again
Create Things
Save Things
Edit Things
Save the Things Again
^
VCS comes into play at this stage.
Version Control Systems keep track of every file change,
and create a Version History (Database)
from these file changes (Versions).
Git is a widely used and very popular VCS.
It is a tool that we install on our computers and tracks
file changes and keeps a history of them (Commits)
It allows multiple users to work
on a Project at the same time.
No Waiting: Continue working while other people
are working on the same Project at the same time.
It supports a powerful feature called: Feature Branches.
Git is a Distributed VCS.
The Database of changes (Version History) is stored
on a central Server and shared among all users.
The Distributed nature of Git enables us to keep track of
each user's changes and contributions over time.
A Real Life Example of a Git Workflow in Production
Step 1
In order for Git to start tracking our Project's files
we first have to initialize our Project's folder
Go to your Project Directory:
> cd myProject
Initialize with Git:
> git init
Git has just created a .git folder inside your Project's folder.
All tracking data and information will be stored inside this folder.
That's it! Git can now start tracking all changes.
Working Directory
Untracked Files
Staging Area
Tracked Files
Git Repository
Commited Files
(Version History)
Working Directory
Staging Area
Git Repository
Untracked Files: Files exist but they are not part of Git's version control.
Tracked Files: Files have been added to Git's version control using the git add command but changes have not been commited (stored) yet.
Commited Files: Changes have been commited using the git commit command and are now stored in your Git Repository (Database of changes)
Local / Remote Repo Synchronization
1) Install Git* and test that everything is working by running:
git --version
Download for Windows
Download for Linux
Download for Mac
2) Create a GitHub Account
*Windows: Check Git Bash
3) Configure Git
git config --global user.name "Joe"
git config --global user.email "your@email.com"
What we'll do...
Commit(s): Git's way of saving (changes) into its History of Changes Database.
Repository (Repo) / Project: All Changes are tracked here
Staging (Area): Control what gets Commited.
Working Directory: Where our Project lives
References and Sources:
• Atlassian Git Tutorial: What is Version Control
• Working With Git
Learn Git in 30 Minutes
• The three stages of Git
• Git Tutorial for Beginners: 4 Git Concepts and Architecture
• Mary Rose Cook: Git from the inside out
• GitHowTo: A guided tour through the fundamentals of Git.
• A Visual Git Reference
• Learn Git Branching
• A Grip On Git: A Simple, Visual Git Tutorial
That's all Folks!