Configure GIT

git config –global “Rakesh PD”
git config –global [email protected]

First-time repository setup/Initializing

$ git init

Add all the project files

To add all file:   $git add -A
To add a file:    $git add

How to ignore files

After initialize open .gitignore file and add the file you dont want to include in git tracking.


git commit -m “Commit message”


git push origin master


git status

Check the changes

git diff

Add remote repository

git remote add origin URL

Create a branch

git checkout -b

Switch branch

git checkout

List branches

git branch

Delete Branch

git branch -d <branchname>

Puch all branch to remote

git push –all origin

Update from the remote 

git pull

Merge branch to active branch

git merge <branchname>

Changes before merging
git diff <sourcebranch> <targetbranch>
Entire commit log

git log