Skip to content
Doug Hagan edited this page Jul 21, 2017 · 9 revisions

Commonly Used Actions

Fetch

Download all branches and changes from the remote repository, and remove orphaned local branches.

> git fetch -p

Pull

Update the current local branch with remote changes.

> git pull

Create Branch

Create a new local branch.

> git checkout -b <branch_name>

Delete Branch

Delete a local branch.

> git branch -d <branch_name>

Checkout

Checkout from an existing branch.

> git checkout <branch_name>

Checkout from an existing tag.

> git checkout tags/<tag_name>

Commit

Commit local changes to a local branch.

> git commit

Enter a descriptive comment.

Push Branch

Upload changes on a local branch to the remote repository.

> git push origin <branch_name>

Tag

Create a marker on the current local branch.

> git tag <tag_name>

Push Tags

Upload markers on all local branches to the remote repository.

> git push origin --tags

Clone this wiki locally