Skip to content

Instantly share code, notes, and snippets.

@prmichaelsen
Forked from Hamatti/git_stuff.sh
Created November 15, 2015 08:04
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 prmichaelsen/2526f0e5ec9c70190b2e to your computer and use it in GitHub Desktop.
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].
#!/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