Tuesday, June 5, 2018

Some necessary git commands

While working on git I had to follow some git commands to execute some tasks which are following:

git Add -A //(add to stage)

git commit 'message' //(commit stage files)

git commit -am 'message' //(add to stage and commit stage files in one command)

git push origin branchName //(push all your local changes to production in specific branch)

git branch branchName //(create branch)

git checkout master //(switch branch to master branch)

git merge branchName //(merge specific branch with selected branch)

git pull origin master //(pull changes from master branch from production)

git branch //(list all created branch)

git branch -d branchName //(delete a specific branch)

git checkout -b branchName //(create and switch to a specific branch in one command)

Hope it may helps someone or me later :)