Saturday, 25 July 2015

Git Interview Question

* What is git?
Git is a distributed version control system.
Git originates from the Linux kernel development and is used by many popular open source projects, e.g., the Android or the Eclipse developer teams, as well as many commercial organizations.
The core of Git was originally written in the programming language C, but Git has also been re-implemented in other languages, e.g., Java, Ruby and Python.

* What is a default branch in git?
You can create a new branch from an existing one and change the code independently from other branches. One of the branches is the default (typically named master). The default branch is the one for which a local branch is automatically created when cloning the repository.

* What is different between author and committer in git?
The author and committer might be different people. The author did the change and the committer applied the change to the Git repository. This is common for contributions to open source projects.

* What is a Head in git?
HEAD is a symbolic reference pointing to the currently checked out branch.

* What is the detached HEAD mode in git?
Sometimes the HEAD points directly to a commit object, this is called detached HEAD mode. In that state creation of a commit will not move any branch.

* How to install drupal using git?
Use Git to locally clone the Drupal core Git repository into a new folder
For Ex:
$ git clone http://git.drupal.org/project/drupal.git folder name

* How to list all of available drupal releases using git?
We will list all of the available releases:
First we move on to the drupal root directory in the command line, then enter the below command
$ git tag -l 7.*
7.0
~
7.1
7.10
7.11
7.12
7.2
7.3
7.4
7.5
7.6
7.7
7.8

* How to checkout latest drupal version using git?
First we should pointing the drupal root directory using command line, then we enter the below command
$ git checkout 7.12

* How to delete git repository?
If you want to delete a Git repository, you can simply delete the folder which contains the repository.



No comments:

Post a Comment