Skip to content

Instantly share code, notes, and snippets.

@meysius
Created March 27, 2019 14:57
Show Gist options
  • Save meysius/083b6bf2a9de513be0f5200a8e3ae76f to your computer and use it in GitHub Desktop.
Save meysius/083b6bf2a9de513be0f5200a8e3ae76f to your computer and use it in GitHub Desktop.

Create a branch

$ git checkout -b name from_branch

Delete a branch

REMOTELY -> $ git push origin --delete name
LOCALLY  -> $ git branch -D name

Switch branch

$ git checkout name

Pull latest from tracked remote branch

$ git pull

Pull latest from untracked remote branch

OPTION 1 -> $ git pull origin branch_name
OPTION 2 -> $ git pull --rebase origin branch_name
OPTION 3 -> $ git merge origin branch_name (I think it is pulling and commiting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment