Skip to content

Instantly share code, notes, and snippets.

@beli-sk
Last active June 30, 2017 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beli-sk/845db5fec95f4df7e738c31de85161bd to your computer and use it in GitHub Desktop.
Save beli-sk/845db5fec95f4df7e738c31de85161bd to your computer and use it in GitHub Desktop.
# show commit tree (possibly append --all for all branches)
git log --graph --oneline --decorate
# save previous as an alias and then just use 'git tree'
git config --global alias.tree "log --graph --oneline --decorate"
# restoring lost commit (e.g. after git reset --hard HEAD~1)
git fsck --lost-found
# or
git reflog
git merge <hash>
# delete branch (remote and local)
git push origin --delete <branch_name>
git branch -d <branch_name>
# if branch has unmerged commits, force delete with '-D'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment