This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| blog:2023:10:12:git-alias [2023-10-12] – created dcai | blog:2023:10:12:git-alias [2024-12-16] (current) – dcai | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== git aliases I use all the time ====== |
| ==== 1. choose branch to check out from fzf ==== | ==== 1. choose branch to check out from fzf ==== | ||
| - | ''' | + | '' |
| < | < | ||
| Line 13: | Line 13: | ||
| - | Sometimes, I want to checkout remote branch, I use alias below, | + | Sometimes, I want to checkout remote branch, I use alias below, '' |
| < | < | ||
| Line 25: | Line 25: | ||
| </ | </ | ||
| - | The idea is list all local branches, but remove current branch (it's marked with *), pipe to fzf so user could select them by pressing | + | The idea is list all local branches, but remove current branch (it's marked with *), pipe to fzf so user could select them by pressing '' |
| Line 46: | Line 46: | ||
| + | ==== 5. Pick a commit, then pick changed file and open in vim ==== | ||
| + | |||
| + | < | ||
| + | edited-files = !git pickhash | xargs -o git show --format=" | ||
| + | pickfile = !git edited-files | fzf --sync | sed -e " | ||
| + | |||
| + | </ | ||