Giter VIP home page Giter VIP logo

git-branches's Introduction

git-branches

List of local Git repository branches with their descriptions.

semantic-release NPM version Build status

That's right: descriptions! This does not use anything custom, just shows the information available in any git repo > v1.7.9

$ git branch --edit-description
; opens editor, write something, save and exit
; or simply use
$ git config branch.master.description "description text"
$ git config branch.master.description
; shows description of branch master

Use the branches.sh script to show all branches with their descriptions at once, for example, I have two branches

$ git-branch-description
* master        this is master branch
one             this is simple branch for testing

This is same information as git branch, with descriptions in the second column.

Install

$ npm install git-br -g

git alias

Alias git sub-command by:

$ git config --global alias.br !git-br

then we can use it like:

$ git br
* master        this is master branch
one             this is simple branch for testing

Adding to .bash_profile

I found it convenient to add this feature as a function to my .bash_profile or .alias file

; .bash_profile
; list git branches with their descriptions
function branches() {
    branch=""
    branches=`git branch --list`
    while read -r branch; do
    clean_branch_name=${branch//\*\ /}
    description=`git config branch.$clean_branch_name.description`
    printf "%-15s %s\n" "$branch" "$description"
    done <<< "$branches"
}

Then anywhere in the shell I can use command branches

Small print

Author: Gleb Bahmutov © 2014

License: MIT - do anything with the code, but don't blame me if it does not work.

Spread the word: tweet, star on github, etc.

Support: if you find any problems with this module, email / tweet / open issue on Github

git-branches's People

Contributors

bahmutov avatar hotoo avatar llcoollasa avatar loisaidasam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.