1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-01-13 22:42:02 +01:00
cheatsheets/git-branch.md
Rico Sta. Cruz 8cc346449f Categories
2015-11-24 15:30:17 +11:00

504 B

title, category
title category
Git branches Git
# create a new branch
  git checkout -b $branchname
  git push origin $branchname --set-upstream

# get a remote branch
  git fetch origin
  git checkout --track origin/$branchname

# delete local remote-tracking branches (lol)
  git remote prune origin

# list merged branches
  git branch -a --merged

# delete remote branch
  git push origin :$branchname

# get current sha1 (?)
  git show-ref HEAD -s