Git FAQs
Git FAQs
. Git
. SVN
. Perforce
. Clear case
Out of all these tools, Git is the most advanced tool in the market
where we are getting so many advantages compare to other
Source Code Management tools.
------------------------------------------------------------------------------------
4. What is Git?
.Speed:-
Git stores every update in the form of versions. For every
version, it takes incremental backup instead of taking whole
backup. Since it is taking less space, Git is very fast. That
incremental backup we call "Snapshot"
.Parallel branching:-
We can create any number of branches as per our
requirement. No need to take prior permission from any one
unlike other Source Code Management tools. Branching is for
parallel development. Git branches allow us to work
simultaneously on multiple features.
.Fully Distributed:-
Backup copy is available in multiple locations in each and every
one's server instead of keeping in one central location unlike
other Source Code Management tools. So even if we lose data
from one server, we can recover it easily. That’s why we call GIT
as DVCS (Distributed Version Control System)
------------------------------------------------------------------------------------
6. What are the stages in Git?
1. Work space:-
It is the place where we can create files physically and
modify. Being a Git user, we work in this work space.
3. Local repository:-
It is the place where Git stores all commits locally. It is a
hidden directory so that no one can delete it accidentally. Every
commit will have unique commit ID.
4. Central repository:-
It is the place where Git stores all commits centrally. It
belongs to everyone who are working in your project. Git Hub is
one of the central repositories. Used for storing the code and
sharing the code to others in the team.
------------------------------------------------------------------------------------
7. What is the common branching strategy in Git?
To move multiple commits into its parent so that you end up with
one commit. If you repeat this process multiple times, you can
reduce "n" number of commits to a single one. Finally we will
end up with only one parent commit. We use this operation just
to reduce number of commits.
------------------------------------------------------------------------------------
22. What is Git hooks?
When you go with git merge, all commits which are there in new
development branch will be merged into current branch where
you are. But sometimes, requirement will be in such that you
would want to get only one commit form development branch
instead of merging all commits. In this case we go with git cherry-
pick. Git cherry-pick will pick only one commit whatever you
select and merges with commits which are there in your current
branch. So picking particular commit and merging into your
current branch we call git cherry-pick.
------------------------------------------------------------------------------------
24. What is the difference between Git and SVN?
SVN:-
It is centralized version control system (CVCS) where back up
copy will be placed in only one central repository.
There is no branching strategy in SVN. You can't create branches.
So no parallel development.
There is no local repository. So can't save anything locally. Every
time after writing code you need to push that code to central
repository immediately to save changes.
Git:-
It is Distributed version control system where back up copy is
available in every one's machine's local repository as well as
central repository.
We can create any no of branches as we want. So we can go with
parallel development simultaneously.
Every Git repository will have its own local repository. So we can
save changes locally. At the end of our work finally we can push
code to central repository.
------------------------------------------------------------------------------------
25. What is commit message in Git?