diff --git a/cheat/sheets/fish-git b/cheat/sheets/fish-git new file mode 100644 index 0000000..da9f467 --- /dev/null +++ b/cheat/sheets/fish-git @@ -0,0 +1,65 @@ +--- +syntax: fish +--- + +# Staging: +ga: 'git add' +gaa: 'git add --all' +gapa: 'git add --patch' + +gd: 'git diff' +gds: 'git diff --staged' +gdw: 'git diff --word-diff' +gdsw: 'git diff --staged --word-diff' + +gst: 'git status --short --branch' +gstl: 'git status' + +# Committing: +gc: 'git commit' +gc!: 'git commit --amend' +gcn!: 'git commit --amend --no-edit' + +gca 'git add --all && git commit' +gca!: 'git add --all && git commit --amend' +gcan!: 'git add --all && git commit --amend --no-edit' + +gcfu: 'git commit --fixup' + +grev: 'git revert' + +# Working dir & index manipulation: +gco: 'git checkout' + +grt: 'git reset' +# grt -- []: undo but keep changes in working dir. + +grts: 'git reset --soft' +# undo commits and stage their changes. + +grs: 'git restore --worktree' +# grs - revert local changes for . +# (--worktree is the default behavior, but included here for clarity). + +grss: 'git restore --worktree --source' +# grss - revert to "s version. + +grst: 'git restore --staged' +# grst - unstage + +grsts: 'git restore --staged --source' +# See grss, but for s. + +grsa: 'git restore --staged --worktree' +# grsa - discard all changes for , both staged and unstaged. + +grsas: 'git restore --staged --worktree --source' + +grm: 'git rm' +# Remove paths from index & working dir. + +grmc: 'git rm --cached' +# Unstage & remove only from index; leave in working dir. +# grmc - where is already tracked: stages the removal of + + diff --git a/git/aliases.config.fish b/git/aliases.config.fish index 36ead95..b7daf49 100644 --- a/git/aliases.config.fish +++ b/git/aliases.config.fish @@ -93,22 +93,14 @@ abbr -a gc --position command "git commit" abbr -a "gc!" --position command "git commit --amend" abbr -a "gcn!" --position command "git commit --no-edit --amend" abbr -a gca --position command "git add --all && git commit" -abbr -a "gca!" --position command "git commit -a --amend" -abbr -a "gcan!" --position command "git commit -a --no-edit --amend" -abbr -a gcam --position command "git commit -a -m" +abbr -a "gca!" --position command "git add --all && git commit --amend" +abbr -a "gcan!" --position command "git add --all && git commit --no-edit --amend" +abbr -a gcam --position command "git add --all && git commit -m" abbr -a gcmsg --position command "git commit -m" abbr -a gcfu --position command "git commit --fixup" abbr -a grev --position command "git revert" -# Update the last commit with all staged changes. -abbr -a gu --position command "git commit --amend" -abbr -a "gu!" --position command "git commit --amend --no-edit" - -# Update the last commit with all local changes. -abbr -a gua --position command "git add --all && git commit --amend" -abbr -a "gua!" --position command "git add --all && git commit --amend --no-edit" - ################################################################################ # Working Dir & Index Manipulation # ################################################################################