What is Git?

Git is a distributed version control system. It means that all developers within a team have a complete version of the project. It is the most widely used modern version control system in the world. A large number of projects rely on Git for version control, including Commercial Projects as well as open-source. using this you'll be able to do the following things.

It Records the changes to project files 
It keeps track of all files in a project 
we can restore previous versions of files 
we can Merge code from the different team members.

Git Installation on Windows:

Download the latest Git for Windows.
To configure your Git username and email, use the following commands:

$ git config --global user.name "Your Name"
$ git config --global user.email "your emsail"

Git Installation on Linux:

To download Git in Linux, use the following command in your terminal:

$ sudo apt-get update $ sudo apt-get install git

Verify the Git Installation:

$ git --version git version 2.9.2

Essential git commands we should know:

1) git config: To set your user-name and email-id in the main configuration file.

2) git init: To initialize the git repository in a new or existing project. eg. $git init

3) git clone:  it is used to copy a git repository from a remote source. eg. $git clone <: clone="" git="" url:="">

    4) git status: It is used to show the status of the files that have been changed. eg. $git status

    5) git add: It is used to add the file to git Repo. eg. $git add . or $git add .

    6) git commit: It is used to commit your chamges. eg. $git commit -m "message".

    7) git branch: This command is used to list all the branches. eg. $git branch.

    8) git merge: it is used to merge two branches. we need to change the branch we want to merge. eg. $git merge

    Post a Comment

    0 Comments