I recently moved from zsh to fish and the thing I miss the most are the git shortcuts...
Such as
gst for git status
gup for git pull --rebase
gp for git push
etc...
I couldn't find any plugin that did this... Can it be enabled by default?
Generally, plugins that only setup aliases are frowned upon as they are too personal. As far as I'm aware there are no plugins of that type in the database. Yet, you can create your own aliases in init.fish with the alias builtin. Like so, alias gst="git status".
I have the following in git_alias.fish which I source from init.fish:
alias gd="git diff"
alias gdc="git diff --cached"
alias ga="git add"
alias gca="git commit -a -m"
alias gcm="git commit -m"
alias gbd="git branch -D"
alias gst="git status -sb --ignore-submodules"
alias gm="git merge --no-ff"
alias gpt="git push --tags"
alias gp="git push"
alias grs="git reset --soft"
alias grh="git reset --hard"
alias gb="git branch"
alias gcob="git checkout -b"
alias gco="git checkout"
alias gba="git branch -a"
alias gcp="git cherry-pick"
alias gl="git lg"
alias gpom="git pull origin master"
Even in zsh I am pretty certain that the git aliases are not enabled by default, and @lfiolhais is right. Aliases are personal and so if we accept one git aliases plugin, it will be joined immediately with 10 other slightly or completely different variants.
Hence, you are left with two options:
init.fish (or some file sourced from it).omf install https://github.com/aayushkapoor206/omf-plugin-gitaliases.gitomf remove gitaliasesHi @aayushkapoor206, you can have a look at my own minimal aliases:
https://github.com/derekstavis/plugin-minimal-git-aliases
Give a look at the names I'm using:
https://github.com/derekstavis/plugin-minimal-git-aliases/blob/master/init.fish
where is the init.fish you guys are referring too, can someone please provide me the path for the file?
@KhaledMohamedP see where your OMF_CONFIG is by running echo $OMF_CONFIG. If init.fish doesn't exist in that path, you can create it.
Most helpful comment
Generally, plugins that only setup aliases are frowned upon as they are too personal. As far as I'm aware there are no plugins of that type in the database. Yet, you can create your own aliases in
init.fishwith thealiasbuiltin. Like so,alias gst="git status".