RT Technologies +91-9019995361: Purushotham Reddy
RT Technologies +91-9019995361: Purushotham Reddy
Version Control
Version control In software engineering, version control is a class of systems responsible for
managing changes to computer programs, documents, large web sites, or other collections
of information.
Version control is a component of software configuration management.
Version control enables multiple people to simultaneously work on a single project.
Each person edits his or her own copy of the files and chooses when to share those changes
with the rest of the team. Thus, temporary or partial edits by one person do not interfere
with another person's work.
Version control systems are a category of software tools that help a software team manage
changes to source code over time.
Git
CVS
SVN
Mercurial
Monotone
Bazaar
TFS
Why-Git
A distributed version control system (DVCS) is a type of version control where the complete
codebase including its full version history is mirrored on every developer's computer.
Distributed development allows for multiple people to be working on the same project at the
same time.
Without version control you would not be able to work on the same file as someone else as
Git Components
Git BrAnch
Git branches are effectively a pointer to a snapshot of your changes. ... Instead of copying
files from directory to directory, Git stores a branch as a reference to a commit. In this sense,
a branch represents the tip of a series of commits it's not a container for commits
This workflow consists of five types of branches, each with different roles:
Master
Feature branch (aka Topic branch)
Release branch.
Hotfix branch.
Develop branch (aka Integration branch
MAster BrAnch
Git, "master" is a naming convention for a branch. After cloning (downloading) a project from
a remote server, the resulting local repository has a single local branch: the so-called "master"
branch. This means that "master" can be seen as a repository's "default" branch
Release Branch
Release branches contain production ready new features The release branch helps isolate the
development of an upcoming version and the current release. The release branch's lifetime
ends when a particular version of a project is released
RT Technologies Purushotham Reddy +91-9019995361
Feature Branch
Feature branch is a source code branching pattern where a developer opens a branch when
she starts working on a new feature. She does all the work on the feature on this branch and
integrates the changes with the rest of the team when the feature is done.
Hotfix Branch
Git fetch command downloads commits, files, and refs from a remote repository into your
local repo Git pull is the more aggressive alternative; it will download the remote content for
the active local branch and immediately execute git merge to create a merge commit for the
new remote content
When you use pull, Git tries to automatically do your work for you.
pull automatically merges the commits without letting you review them first
Git conflicts
A conflict arises when two separate branches have made edits to the same line in a file, or
when a file has been deleted in one branch but edited in the other.
Conflicts will most likely happen when working in a team environment.
RT Technologies Purushotham Reddy +91-9019995361
A branching strategy ensures everyone on the team is following the same process for making
changes to source control.
A develop branch is created from master. ... Feature branches are created from develop.
When a feature is complete it is merged into the develop branch. When the release branch is
done it is merged into develop and master. If an issue in master is detected a hotfix branch is
created from master
RT Technologies Purushotham Reddy +91-9019995361
Git Vs GitHub
Merge vs RebAse
Git rebase and merge both integrate changes from one branch into another. Where they d i
f fe r is h ow i t's d o n e . Git rebase moves a feature branch into a master.
Git merge adds a new commit, preserving the history.
RT Technologies Purushotham Reddy +91-9019995361
Git Vs SVN
RT Technologies Purushotham Reddy +91-9019995361
Git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by
reference and appended to the current working HEAD.
Cherry picking is the act of picking a commit from a branch and applying it to another.
You can switch to the correct branch and cherry- pick the commit to where it should belong
Pull request
Pull requests are a mechanism for a developer to notify team members that they have
completed a feature. Once their feature branch is ready, the developer files a pull request via
their Bitbucket account
RT Technologies Purushotham Reddy +91-9019995361
Tags are ref's that point to specific points in Git history. Tagging is generally used to capture
a point in history that is used for a marked version release (i.e. v1. 0.1).
A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no
further history of commits
To create a repository, create a directory for the project if it does not exist, then run the
command git init
directory.
RT Technologies Purushotham Reddy +91-9019995361
Git Commands:
GIT BASICS:
1 git log Show the commit history for the currently active
RT Technologies Purushotham Reddy +91-9019995361
branch
2 git log branchB..branchA Show the commits on branchA that are not on
branchB
3 git log --follow [file] Show the commits that changed file, even across
renames
4 git show [SHA] Show any object in Git in human-readable format
5 git diff branchB...branchA Show the diff of what is in branchA that is not in
branchB
1 git rm [file] Delete the file from project and stage the removal
for commit
2 git mv [existing-path] [new- Change an existing file path and stage the move
path]
3 git log --stat -M Show all commit logs with indication of any paths
that moved
RT Technologies Purushotham Reddy +91-9019995361
REWRITE HISTORY
TEMPORARY COMMITS
Conclusion
Git provides a way of keeping track of past versions of software and papers, making collaboration
between various authors easy, and provides backup for your software. It has proven very useful
to the open-source community and in academia as well.
its concepts. What it does have, however, is a solid base to work from. In the future, I imagine
many new methods will be devised to take advantage of the flexibilities Git allows. Most other
that all else from
posite
promises
RT Technologies Purushotham Reddy +91-9019995361
RT Technologies
+91-9019995361