show git aliases

This commit is contained in:
Malin Freeborn 2024-12-05 18:07:16 +01:00
parent a62ddf2408
commit 6882610a0e
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

41
setup/git-aliases.md Normal file
View File

@ -0,0 +1,41 @@
---
volume: Decentrala
section: 6
title: git aliases
author: Malin
source: dmz.rs
---
## Aliases
Put these in `~/.bash_aliases`
```
alias gb='git branch'
alias gc='git add -p . && git commit'
alias gd="git diff --word-diff"
alias gl='git log --graph --show-signature'
alias gla="git log --all --decorate --oneline --graph"
alias gm='git merge'
alias gis='git status'
```
## Dangerous Aliases
Get a fuzzy-finder, like `fzy,` or `sk` (called `sk-im` in the repos), and checkout faster:
```
alias gco='git checkout --recurse-submodules $(sk -c "git branch | cut -c 3-")'
```
Delete all changes and start again instantly:
```
alias grs='git reset --hard HEAD'
```
Push to remotes that don't use http:
```
alias gpa='git remote show | while read remote; do git remote get-url $remote | grep -qv http && git push $remote; done'
```