Skip to content

A custom command for git to support branch alias and association.

Notifications You must be signed in to change notification settings

gera2ld/git-ass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-ass

A custom command for git to support branch alias and association.

  • The main script is written in pure Python 3 and has no third party dependencies.
  • The autocomplete script works for Zsh.

Installation

  1. Clone the project

    $ git clone https://github.com/gera2ld/git-ass.git
  2. Add executable path

    export PATH=$PATH:/path/to/git-ass/bin
  3. Enable autocompletion for Zsh

    # ~/.zshrc
    
    source path/to/git-ass/scripts/init.zsh

Usage

Abbreviation is recommended:

alias a='git ass'
  • Set base

    E.g. add current branch as a development branch, and expect it to be merged into the release branch release-1.0.

    $ git ass add -B release-1.0
  • Alias and description

    E.g. add alias awesome and a description to current branch.

    $ git ass add -a awesome -d 'This is an awesome branch'
  • Show information of current branch

    # Show all ancestors
    $ git ass info
    
    # Show specified property of current branch
    $ git ass info -p alias
  • List recorded branches

    $ git ass list
  • Check out branch by alias

    # Check out `awesome`
    $ git ass checkout awesome
    # or
    $ a co awesome
  • Rebase

    E.g. the current branch is a development branch and based on the release branch release-1.0 as described above, then the following command will rebase the current branch on top of the release branch.

    $ git ass rebase
  • Find a branch by alias

    $ git ass find awesome
    # or
    $ a f awesome
  • Use with git

    $ git checkout `git ass find awesome`
    # or
    $ gco `a f awesome`
  • Purge locally merged branches

    $ git ass purge
  • Prune inexistent branches

    $ git ass prune

About

A custom command for git to support branch alias and association.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published