Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Category Archive Git

Git commands

May 18, 2018 Comments Off on Git commands By MANOJ AGARWAL

Clone a remote repository

To clone master branch from remote repository on local machine:

# git clone -b master <git url>

Checkout branches

To checkout branches other than master:

# git checkout –track origin/<branch1>

# git checkout –track origin/<branch2>

Add untracked files to git

# git add

Add all files to staging area

# git add -A

Check tracked/untracked files

# git status

Commit files to git

# git commit -m “message”

Commit all files to git

# git commit -a -m “message”

Check all commits

# git log

Create a branch

# git branch

Delete a branch

# git branch -D <branchname>

View all branches in local repository

# git branch

View all branches in remote repository

# git branch -a

Switch to another branch

# git checkout <branchname>

Push changes from local copy to remote

# git push origin master

x Close

Like Us On Facebook

You cannot copy content of this page.