Skip to content

Instantly share code, notes, and snippets.

@MAJA-Lin
Last active February 14, 2018 02:43
Show Gist options
  • Save MAJA-Lin/fa1fba51e592bb63ae9f50f9e1e81621 to your computer and use it in GitHub Desktop.
Save MAJA-Lin/fa1fba51e592bb63ae9f50f9e1e81621 to your computer and use it in GitHub Desktop.
Markdown Complicated commands

::: slide

Git

Complicated commands :::

::: slide

Tree graph

Simple tree (start with oneline):

git log --graph --oneline --all

With --all parameter, it will show all commits Simple Oneline :::

::: slide

Tree graph

Simple tree (start with oneline 2)

You can also make it more beautiful like this:

git log --graph --decorate --pretty=oneline --abbrev-commit Simple Oneline Pt.2

:::

::: slide

Tree graph (beautiful one)

git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all

Advanced graph :::

::: slide

Tree graph (beautiful two)

git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all

Advanced graph 2

:::

::: slide

Delete local branch that its origin alreay merged to master/develop

git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d

:::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment