Custom Git aliases manager. Included some common aliases (see below).
Getting:
git clone https://github.com/nikuz/git-aliases.git
./install.sh
Your original /home/username/.bash_profile has been backed up to /home/username/.bash_profile.bak
aliasName
aliasDescription
Install it? y
Installation proceeds interactively. Will ask you for each included alias to install it. You can say ./install.sh -q
for quiet mode. In quiet mode will be installed all included aliases, and shown statistics after install is complete.
You can install only needed alias by name:
./install.sh co ci br
Also in quiet mode:
./install.sh -q co ci br
Aliases will installed --global
in git config. Also will be created bash_profile aliases with g
prefix.
alias gbr='git br'
alias gci='git ci'
You need update profile environment, for start using it.
. /home/username/.bash_profile
All installed aliases and modules will stored in /home/username/.git_aliases/
folder. You can edit them there after installing for change them functionality.
By name:
./delete.sh co ci br
All in quiet mode:
./delete.sh -q -all
Will delete file from /home/username/.git_aliases/
, git alias from --global
git config, alias from .bash_profile
.
./create.sh
Will ask you some question:
Alias name: ***
Short description: ***
It's background module? y/n
It's "before push" module? y/n
New alias placed here:
.git_aliases/newAlias.sh
Do you want edit it now? y/n
Do you want install it now? y/n
In this way will create new alias, which you need edit and install after creating.
This alias manager supplied with some default aliases and modules.
Modules:
_clean.sh
- check that "working directory clean"_config
- some common variables_help
- for showing aliases help byaliasName -h
_printColor
- for print colored terminal log_printMultiline
- for print functions answers in multiline mode_question
- for getting answers from user_beforePush
- will run modules that registered asbeforePushModules
in_config
before commit and push local changes to remote origin. IfbeforePush
module returnFalse
, commit and push will rejected.__grunt
- this is one ofbeforePushModules
. Will run grunt tasks, ifGruntfile.js
is present in working directory and tasks registered throughgrunt.registerTask
Below presented aliases. Format of them presentation must not be changed. It required for _help
module.
git aliases - galiases
usage: galiases
Show list of installed aliases
git br - gbr
usage: gbr branchName_issueNumber
Will create new branch from actual master and goes into new branch. issueNumber
is required. Will ask if not defined.
git ci - gci
usage: gci [comment]
Will run beforePushModules
. If success passed, will git add .
, git commit -m "comment #issueNumber"
.
If comment don't defined, comment will be is the "fix" string.
git co - gco
usage: gco
Git pull current branch from remote origin to local. And print git status
git go - ggo
usage: goo branch_name
Goes to branch_name if it exists.
git list - glist
usage: glist [revision_hash]
Print list of committed files from last commit or from defined commit.
git ph - gph
usage: gph [branch_name]
Will run beforePushModules
. If success passed, will git push origin branch_name:branch_name
.
If branch_name don't defined, will push current branch.
git pl - gpl
usage: gpl [branch_name]
git pull origin branch_name:branch_name
. If branch_name don't defined, will pull current branch.
git st - gst
usage: gst [options...] [--] [pathspec...]
Git status
git i - gi
usage: gi
Git branch
git rmc - grmc
usage: grmc
rm -rf conflicted files
git rmb - grmb
usage: grmb [branches]
Delete defined branches, or all branches exclude master and current branch.
git inmaster - ginmaster
usage: ginmaster
Merge current branch with master and push master to origin.
git fth - gfth
usage: gfth [branchName]
Git fetch remote branch to local repository and checkout to new branch
git clear - gclear
usage: gclear [files]
Clear unstaged changes. If files don't defined, will clear all unstaged changes.
git sth - gsth
usage: gsth [command]
Git stash. Will run git add .
before stash.
git df - gdf
usage: gdf [options...] [--] [pathspec...]
Git diff
git rs - grs
usage: grs
Remove last commit from log, files stay modified.
git l - gl
usage: gl
git log --graph
./delete.sh (aliasName | -all) [-q]
Delete aliases by name. Can take many aliases by one time.
For delete all aliases. Need request -all
-q for quiet mode