-
-
Save prmichaelsen/2526f0e5ec9c70190b2e to your computer and use it in GitHub Desktop.
Added some alias stuff to display git branch description everytime I do git status (or gs as it's aliased for me). That helps me keep on track with branches that are named like issue-[nro] or fix-[nro].
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function parse_git_branch_name { | |
git rev-parse --abbrev-ref HEAD | |
} | |
function parse_git_description { | |
git config branch.$(parse_git_branch_name).description | |
} | |
echo $(parse_git_branch_name): "$(parse_git_description)" && git status | |
alias gs='echo $(parse_git_branch_name): "$(parse_git_description)" && git status' | |
# DESCRIPTION: | |
# This script displays the status and description | |
# of the current branch | |
# USAGE: | |
# 1. Make sure this file is named 'git-info' with no extension | |
# 2. Place this file into the same directory as git (should be \bin) | |
# 3. Use git info to run this command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment