What is GIT?
GIT is a distributed version control system and source code management (SCM) system with an emphasis to handle small and large projects with speed and efficiency.
What is a repository in GIT?
A repository contains a directory named .git, where git keeps all of its metadata for the repository. The content of the .git directory are private to git.
What is the difference between GIT and SVN?
The difference between GIT and SVN is
·         Git is less preferred for handling extremely large files or frequently changing binary files while SVN can handle multiple projects stored in the same repository.
·         GIT does not support ‘commits’ across multiple branches or tags.  Subversion allows the creation of folders at any location in the repository layout.
·         Gits are unchangeable, while Subversion allows committers to treat a tag as a branch and to create multiple revisions under a tag root.
What are the advantages of using GIT?
·         Data redundancy and replication
·         High availability
·         Only one.git directory per repository
·         Superior disk utilization and network performance
·         Collaboration friendly
·         Any sort of projects can use GIT
Why GIT better than Subversion?
GIT is an open source version control system; it will allow you to run ‘versions’ of a project, which show the changes that were made to the code overtime also it allows you keep the backtrack if necessary and undo those changes.  Multiple developers can checkout, and upload changes and each change can then be attributed to a specific developer.
What is GIT stash?
GIT stash takes the current state of the working directory and index and puts in on the stack for later and gives you back a clean working directory.  So in case if you are in the middle of something and need to jump over to the other job, and at the same time you don’t want to lose your current edits then you can use GIT stash.
What is GIT stash drop?
When you are done with the stashed item or want to remove it from the list, run the git ‘stash drop’ command.  It will remove the last added stash item by default, and it can also remove a specific item if you include as an argument.
What is the function of git clone?
The git clone command creates a copy of an existing Git repository.  To get the copy of a central repository, ‘cloning’ is the most common way used by programmers.
What is GIT protocol?
Git protocol is a mechanism for transferring data in GIT. It is a special daemon. It comes pre-packaged with GIT. It listens on a dedicated port 9418. It provides services similar to SSH protocol. But Git protocol does not support any authentication.
So on plus side, this is a very fast network transfer protocol. But it lacks authentication.
What is the function of ‘git config’?
The ‘git config’ command is a convenient way to set configuration options for your Git installation.  Behaviour of a repository, user info, preferences etc. can be defined through this command.
What is a ‘conflict’ in git?
A ‘conflict’ arises when the commit that has to be merged has some change in one place, and the current commit also has a change at the same place. Git will not be able to predict which change should take precedence.
What is git grep?
GIT is shipped along with a grep command that allows us to search for a string or regular expression in any committed tree or the working directory.
By default, it works on the files in your current working directory.
What is GIT version control?
With the help of GIT version control, you can track the history of a collection of files and includes the functionality to revert the collection of files to another version.  Each version captures a snapshot of the file system at a certain point of time. A collection of files and their complete history are stored in a repository.
Mention some of the best graphical GIT client for LINUX?
Some of the best GIT client for LINUX is
·         Git Cola
·         Git-g
·         Smart git
·         Giggle
·         Git GUI
·         qGit
What is Subgit? Why to use Subgit?
‘Subgit’ is a tool for a smooth, stress-free SVN to Git migration.  Subgit is a solution for a company -wide migration from SVN to Git that is:
·         It is much better than git-svn
·         No requirement to change the infrastructure that is already placed
·         Allows to use all git and all sub-version features
·         Provides genuine stress –free migration experience.
What is the function of ‘git checkout’ in git?
A ‘git checkout’ command is used to update directories or specific files in your working tree with those from another branch without merging it in the whole branch.
What is the function of ‘git rm’?
To remove the file from the staging area and also off your disk ‘git rm’ is used.
What is the function of ‘git stash apply’?
When you want to continue working where you have left your work, ‘git stash apply’ command is used to bring back the saved changes onto the working directory.
What is shortlog in GIT?
A shortlog in GIT is a command that summarizes the git log output.
The output of git shortlog is in a format suitable for release announcements.
What is a commit message in GIT?
A commit message is a comment that we add to a commit. We can provide meaningful information about the reason for commit by using a commit message.
In most of the organizations, it is mandatory to put a commit message along with each commit.
Often, commit messages contain JIRA ticket, bug id, defect id etc. for a project.
What is a bare repository in GIT?
A repository created with git init –bare command is a bare repository in GIT.
The bare repository does not contain any working or checked out copy of source files. A bare repository stores git revision history in the root folder of repository instead of in a .git subfolder.
It is mainly used for sharing and collaborating with other developers.
We can create a bare repository in which all developers can push their code.
There is no working tree in bare repository, since no one directly edits files in a bare repository.
Why do we use git log command?
We use git log command to search for specific commits in project history.
We can search git history by author, date or content. It can even list the commits that were done x days before or after a specific date.
What is merge conflict in GIT?
A merge conflict in GIT is the result of merging two commits. Sometimes the commit to be merged and current commit have changes in same location. In this scenario, GIT is not able to decide which change is more important. Due to this GIT reports a merge conflict. It means merge is not successful. We may have to manually check and resolve the merge conflict.
What is Rebasing in GIT?
Rebasing is the process of moving a branch to a new base commit. It is like rewriting the history of a branch.
In Rebasing, we move a branch from one commit to another. By this we can maintain linear project history.
Once the commits are pushed to a public repository, it is not a good practice to use Rebasing.
What is a pull request in GIT?
A pull request in GIT is the list of changes that have been pushed to GIT repository. Generally these changes are pushed in a feature branch or hotfix branch. After pushing these changes we create a pull request that contains the changes between master and our feature branch. This pull request is sent to reviewers for reviewing the code and then merging it into develop or release branch.
What is git clone in GIT?
In GIT, we use git clone command to create a copy of an existing GIT repository in our local.
This is the most popular way to create a copy of the repository among developers.
It is similar to svn checkout. But in this case the working copy is a full-fledged repository.
What are the disadvantages of GIT?
GIT has very few disadvantages. These are the scenarios when GIT is difficult to use. Some of these are:
Binary Files: If we have a lot binary files (non-text) in our project, then GIT becomes very slow. E.g. Projects with a lot of images or Word documents.
Steep Learning Curve: It takes some time for a newcomer to learn GIT. Some of the GIT commands are non-intuitive to a fresher.
Slow remote speed: Sometimes the use of remote repositories in slow due to network latency. Still GIT is better than other VCS in speed.
Request to Download PDF

Post A Comment:

0 comments: