This document provides an overview and summary of a session on Git basics and workflow:
- The session plan outlines basics of version control, introduction to centralized and distributed version control systems, basics of Git, and introduction to Gitflow workflow.
- It discusses why version control is needed and describes local, centralized, and distributed version control systems such as Subversion and Git.
- Key Git concepts are defined including repository, cloning, adding, committing, pushing, pulling, merging, branches, and tags.
- Finally, the Gitflow workflow is presented, outlining main and supporting branches including features, releases, hotfixes and their naming conventions.
2. Audience
● Who deal with source code
● Who have a basic idea about
source code versioning
● Leads who responsible for
maintaining repositories
3. Session Plan
● Basics about version control
● Introduction to Centralized & Distributed Version Control
● Basics about Git
● Introduction to Gitflow workflow (Branching model)
4. Do We Need Version Control?
1. index.html
2. index_new.html
3. index_new_v2.html
4. index_new_v4.html
5. index_new_v2_final.html
6. index_new_v2_really_final.html
5. Types of version control systems
● Local Version Control System
● Centralized Version Control System
● Distributed Version Control System
6. Centralized version control
systems
Centralized version control systems are based on the idea that there
is a single “central” copy of your project somewhere (probably on a
server), and programmers will “commit” their changes to this central
copy.
● Subversion (SVN)
7. Distributed version system
Distributed version systems do not necessarily rely on a central
server to store all the versions of a project’s files. Instead, every
developer “clones” a copy of a repository and has the full history of
the project on their own hard drive. This copy (or “clone”) has all of
the metadata of the original.
● Git
9. Git
Git is a free and open source version control system, originally
created by Linus Torvalds in 2005. Unlike older centralized version
control systems such as SVN and CVS, Git is distributed: every
developer has the full history of their code repository locally.
Github is a service for hosting software repositories managed by the
Git version control system. GitHub was developed by Chris
Wanstrath, PJ Hyett, Scott Chacon and Tom Preston-Werner using
Ruby on Rails and Erlang and launched in February 2008.
Then What is Github..??
16. Feature Branches
Feature
May branch off from:
develop
Must merge back into:
develop
Branch naming convention:
anything except master,
develop, release-*,
or hotfix-*
17. Release Branches
May branch off from:
develop
Must merge back into:
develop and master
Branch naming convention:
release-*
Release
18. Hotfix Branches
May branch off from:
master
Must merge back into:
develop and master
Branch naming convention:
hotfix-*
Hotfix
19. Tags
Tags can be considered as bookmarks for commits.
A good practise is to create and push tags for each release builds, with version name.