All github command details.

Here i am going to list all the github command i use for my daily needs.

Cloning a git repository  : 

Following command is used to clone a github repository to local computer. To execute this command just visit the directory you want to clone remote git branch .

git clone “Url of the github repository name”

Checking out a git branch :

To checkout a git branch needs to use following command

git checkout “branch_name”

Overwrites master branch with another branch:

To overwrites master branch with another branch just follow below steps.

First checkout your master branch  :

git checkout master

Then overwrite master with your other branch :

git reset –hard better_branch

Force the push to your remote repository :

git push -f origin master

 

Leave a Reply