🤟
🅛🅐🅩🅨🅖🅘🅣 Tired of typing lengthy git commands? Well, if you are amongst who feel like me, this repo is a savior for you. This repo includes shorthand commands for the regular git commands which you can type in a jiffy.
- I'd advice beginners to learn git commands first hand before using any shortcodes or aliases
Installation
- Clone or Download the repo.
- Run
./_install
to install - If you see any permissions related errors try
➡️ chmod 755 _install
and run./_install
again. or any error please raise a PR😅 - Type
gb
to verify the installation and you must see git related output. If not try re-starting your terminal and try again.
Short Codes List
Function | Shortcode | Can pass default params with the function ? | Details |
---|---|---|---|
git push <remote> <current-branch> |
gph-this <remote> |
No | Utility Function to push the current branch |
git pull <remote> <current-branch> |
gpl-this <remote> |
No | Utility Function to pull the current branch |
Command | Shortcode | Can pass default params with this command ? | Git Repo Link |
---|---|---|---|
git init [<options>] |
g! [<options>] |
Yes | |
git add . |
g. |
Yes | |
git branch |
gb |
Yes | |
git branch -a |
gb-a |
Yes | |
git branch -d |
gb-d |
Yes | |
git branch -m <name> |
gb-name <name> |
Yes | |
git checkout -b <name> |
gb-new <name> |
No, You can only pass branch-name and --track or --no-track |
|
git checkout -- . |
g!. |
No, Discards all your changes | |
git blame |
gblame |
Yes | |
git clone <url> |
gcl <url> |
Yes | |
git commit -m <message> |
gc <message> |
No, it accepts only commit message | |
git diff [--options] <commit> [--] [<path>…] |
gd [--options] <commit> [--] [<path>…] |
Yes | |
git fetch [<options>] [<repository> [<refspec>…] |
gf [<options>] [<repository> [<refspec>…]] |
Yes | |
git log --graph --decorate --all |
gl |
No | |
git log --summary |
gl-s |
Yes | |
git push [<options>] [<remote>] [<branch>] |
gph [<options>] [<remote>] [<branch>] |
Yes | |
git push -f [<remote>] [<branch>] |
gph-f <remote> <branch> |
Yes | |
git pull [options] [<repository> [<refspec>…]] |
gpl [options] [<repository> [<refspec>…]] |
Yes | |
git remote [commands] [<...>] |
gr [commands] [<...>] |
Yes | |
git remote -v |
gr-v |
It acceps only <show> and <update> |
|
git remote add <name> <url> |
gr-update <name> <url> |
It accepts options related to <add> |
|
git remote update |
gr-update |
Only accepts <prune> |
|
git remote remove <name> |
gr-remove <name> |
No other options are needed other than <name> |
|
git reset [<mode>] <head> |
greset [<mode>] <head> |
Yes | |
git reset --hard <head> |
greset-h <head> |
Takes only <head> |
|
git revert [<options>] [<subcommands>] |
grevert [<options>] [<subcommands>] |
Yes | |
git revert HEAD |
grevert-h |
This reverts last commit only, Use the above for reseting other commits eg., grevert head~2 |
|
git status [<options>…] [--] [<pathspec>…] |
gs [<options>…] [--] [<pathspec>…] |
Yes | |
git stash [<command>] [<options>] |
gsh [<command>] [<options>] |
Yes | |
git stash apply [--index] [<stash>] |
gsh-a [--index] [<stash>] |
Yes | |
git stash list [<options>] |
gsh-l [<options>] |
Yes | |
git stash clear |
gsh-c |
No It clears all the stash list | |
git stash pop [--index] |
gsh-p [--index] |
Yes | |
git stash drop [<stash>] |
gsh-d [<stash>] |
Yes | |
git tag -l --sort=v:refname | tail -n8 |
gt |
No | |
git add . && git commit -m |
g.c <message> |
No, it accepts only commit message | |
git rebase [< All options>] |
grb [<All options>] |
Yes | |
git show [<options>] [<object>] |
gsw [<options>] [<object>] |
Yes |
To Contribute
I have added commands that I use frequently and scope for new commands (Bash Aliases) is less. But if you are interested you can raise a PR or please follow this branch
Tasks
-
Add Bash file with basic commands - Add Install via npm WIP
-
Add Install via pip(If interested, work and raise a PR)