Skip to content

AndreiLucaci/git-shortcuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-shortcuts

Usefull git shortcuts and autocomplete for the git-scm distribution of the bash terminal on Windows.

Commands

Shortcut Git command
less "less -r"
ls "ls -F --color --show-control-chars"
ll "ls -l"
gs "git status "
gss "git status -s"
gp "git pull -r"
gh "git push "
gho "git push -u origin "
up "git push "
upo "git push -u origin "
ga "git add "
gaa "git add -A"
gb "git branch "
gc "git commit "
gcm "git commit -m "
gd "git diff"
go "git checkout "
gob "git checkout -b"
gk "gitk --all&"
gx "gitx --all"
got "git "
get "git "
g "git "
gm "git merge "
gr "git reset "
gdf "git clean -f"

Instalation

Windows:

Automatic

copy settings.bat which deployes the settings automatically in %UserProfile% folder

Manual

Add .bashrc and .bash\_profile your current username app data folder (%UserProfile%). If you want also the monokai theme, add .minttyrc to the same folder as well.

File Description
.bashrc Contains the aliases (shortcuts) for the git commands
.bash_profile Contains autocomplete commands for the aliases (aka. use tab for autocomplete on known names)
.minttyrc Contains monokai theme for the mintty editor

Linux:

You can just copy the settings from the .bashrc file in your settings folder and source it in the .bash_profile.

MacOs:

There is also a file for .zsh with configurations build for that.

Instructions:

Direct download

  1. Download this file
curl -o ~/.git-shortcuts.zsh https://raw.githubusercontent.com/AndreiLucaci/git-shortcuts/master/.zshrc
  1. Source it from your main ~/.zshrc:
source ~/.git-shortcuts.zsh
  1. Reload your shell:
source ~/.zshrc

Modular (recommended)

If you want an alternative modular approach... this keeps your shell config clean and scalable.

  1. Create a config folder:
mkdir -p ~/.zshrc.d
  1. Download the shortcuts file:
curl -o ~/.zshrc.d/git-shortcuts.zsh https://raw.githubusercontent.com/AndreiLucaci/git-shortcuts/master/.zshrc
  1. Add this once to your main ~/.zshrc:
for file in ~/.zshrc.d/*.zsh; do
  [ -r "$file" ] && source "$file"
done
  1. Reload:
source ~/.zshrc

This is distributed under GNU GPL 3 licence.

Happy productivity

About

Usefull git shortcuts and autocomplete

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published