diff --git a/README.md b/README.md index e9c6062..b3e88a3 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) * [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) * [specific color settings](#specific-color-settings) +* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) @@ -787,5 +788,10 @@ git config --global color.ui false git config --global ``` +## Show all local branches ordered by recent commits +```sh +git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ +``` + diff --git a/tips.json b/tips.json index eff5643..f69c476 100644 --- a/tips.json +++ b/tips.json @@ -345,4 +345,7 @@ },{ "title": "specific color settings", "tip": "git config --global " +},{ + "title": "Show all local branches ordered by recent commits", + "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" }]