Aliasing Your Git Commands for Maximum Developer Efficiency
11–20 of 31 posts
Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#12Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#13Eh. I've only ever aliased "git status -s | awk '$1 == "M" { print $2 }' | xargs -t git add" as "git_add_all": branch switching works well enough in VSCode, "git diff" shows you your commit preview perfectly fine, and shortening "git push" and "git commit" never really felt like a pressing concern. Actually, no, there is also "git_show_branch" because every time I needed that in the shell, I could never remember the…
Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#14 ```
s="git status"
d="git diff"
c="git diff --cached"
```
I have one other, `rb`, which uses a lot of intermediate work to print all the recent branches I've committed to with nice conditional formatting.Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#15Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#16Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#17I have several git alias that I live by: ga = git add -A gc = git commit gcm = git commit -m gp = git push All of these are defined in my zshrc rather than doing it through git config.
Same thing - I put them in my shell. Here is the list I use: alias ga="git add" alias gaw="git add -A && git diff --cached -w | git apply --cached -R" alias gb="git branch" alias gbl="git branch -l" alias gbD="git branch -D" alias gbu="git branch -u" alias gc="git commit" alias gca="git commit -a" alias gcaa="git commit -a --amend" alias gcam="git commit -a -m" alias gce="git commit -e" alias gcfu="git commit --fixup…
Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#18Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#19Earlier quoted context omitted.
Same thing - I put them in my shell. Here is the list I use: alias ga="git add" alias gaw="git add -A && git diff --cached -w | git apply --cached -R" alias gb="git branch" alias gbl="git branch -l" alias gbD="git branch -D" alias gbu="git branch -u" alias gc="git commit" alias gca="git commit -a" alias gcaa="git commit -a --amend" alias gcam="git commit -a -m" alias gce="git commit -e" alias gcfu="git commit --fixup…
I would guess a list this long is self defeating. You wouldn't remember the ones you don't use often but would have a better chance remembering the full command because the language of the command is more intuitive.
Looking at the other posts in the thread, it looks like this set of aliases is very similar (maybe I should switch to cut some fat out of my dotfiles): https://kapeli.com/cheat_sheets/Oh-My-Zsh_Git.docset/Content...
Re: Aliasing Your Git Commands for Maximum Developer Efficiency
#20One of my favorites is gsw=“git switch -“. It switches back to whatever branch you were last on.