Here are some git commands that you will normally use in a git version controlled project repository.


For Commiting all modified files use

git commit -am”Message”


For checking the status of the git repository use

git status


For getting the information about the Git checkins use…

git log

To Print in a convenient one line use

git log —oneline

Get the short log

git shortlog

Add Updated Files

To Add all the modified files to the git repository…

git add -u

Add all newly created files

git add -A


git checkout file_name

Clean the local repository

git clean -n

Ignore Files

First you have to add the .gitignore file.

vim .gitignore

Then write the files and folders you want to ignore…

For example, if you want to ignore files in logs directory
You can write the file contents like this…


Don’t forget to commit the .gitignore file as well.


Clone the whole repository to your local repository

git clone clone_url

To find the git url you have cloned

git remote -v

Tag a Repository

This will tag the repository with name “Version1.0”

git tag Version1.0

Update a Repository

git pull


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.