What is Git? Common Git Commands

Posted at March 4, 2016 at 4:50 pm by Jithin

In this documentation, we can check what is Git and common Git commands.

 

Git is an efficient open source version control system. It tracks contents such as files and directories. It manages changes to a project without overwriting any part of the project.

 

Install Git on Linux

We can install the Git on Linux servers using the following commands:

In Fedora:

       yum install git

In Ubuntu:

       apt-get install git

 

Commands:

Initializes a git repository.

git init

 

Add file to the repository.

git add

 

To commit commands.

git commit  -a

 

View the current log.

git log

 

Check the current status.

git status

 

Create branch.

git branch branch_name

 

List all branches.

git branch

 

Delete the branch.

git branch -d branch_name

 

Create a Tag.

git tag tag_name

 

Delete the Tag.

git tag -d  tag_name

 

Push Tags.

git push –tags

 

View all the merge conflicts.

git diff

 

Set configuration values

git config

 

Make a git repository copy from a remote source.

git clone

 

Remove files from index.

git rm

 

Check out a different branch.

git checkout

 

Merge branches.

git merge

 

Reset the index and working directory.

git reset

 

Fetch all the objects.

git fetch.

 

Show all the remote versions of your repository.

git remote

 

Show information about a git object.

git show

 

Show tree object.

git ls-tree

 

View the type of an object.

git cat-file

 

Graphical Tcl/Tk based interface to a local git repository.

gitk

 

If you need any further help please reach our support department.

 

 

0.00 avg. rating (0% score) - 0 votes

You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply