This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
Consider putting related commands together, such as push and pull,
to decide how to execute based on the current environment or specified parameters.
This mode is more convenient, but more difficult to implement in traditional shells such as zsh.
In nushell it's very easy.
In this way, the commands that need to be memorized will be greatly reduced, and the parameters can be automatically completed. In the most common scenarios, it is even possible to omit the parameter.
In contrast, the behavior of commands requires fine-tuning to be intuitive. (there may still be some unreasonable places that need to be adjusted)
I tried to tidy part of it, and it is basically usable. (The goal is to organize all aliases to where they should go)
gs
Git status and stash.
gl
Git log and show.
gb
About the branch.
Create branch if it doesn't exist, switch otherwise (branch are automatically completed), use -d to delete.
If there is no branch as an argument, the branch is displayed.
gp
Pull, push and other related to remote repositories
We assume that the upstream and downstream branches keep the same name and do not operate across branches.
--cloneto clone--submodulesubmodule update and submodule init (with--init)--forcepush --force (assumepull --forcedoesn't make sense)--initgit init--overridejust used to trigger a github actions event (in fact, webhooks can also be used)--set-upstreampush --set-upstream- if branch is specified, it is
git fetch(let's assume you don't like pulling from a different branch) - finally, if no branch and above parameters are specified
git pullto update.- if
ahead,git pushwill be executed.
ga
Git add, rm and restore. about files.
Use ga because git add has the highest execution frequency,
and ga is the most convenient input.
--deletegit rm--restoregit restore- git add
gc
Git commit
gd
Git diff
gm
Git merge and rebase
--rebasegit rebase- git merge
gcp
Git cherry-pick
gr
Git reset
grmt
Git remote
gbs
Git bisect
changelog
2023-05-18
gp -ucan omit branch- delete
grb - improve the premise in the description