3 ms·
My favorite aliases (these scripts keep working and I wrote them YEARS ago so they might be optimize-able) [alias] fb = !fzf_prompt.sh
by from-nibly 3y ago
My favorite aliases (these scripts keep working and I wrote them YEARS ago so they might be optimize-able)
[alias]
fb = !fzf_prompt.sh # prompts the user with an fzf prompt to fuzzy search for branches
cheese-touch = "log -n 1 --format=format:'%an' --" # displays who edited a file last
destroy = "!git reset HEAD~1 && git add --all . && git reset --hard" # destroys top commit
sc = "commit --amend --no-edit" # *jackie chan's uncle voice* one more thing!
pushf = "push --force-with-lease" # *lego batman voice* first try!
all = "!git add --all . && git status" # I forget that this doesn't exist on everyone's computer.
cp = "cherry-pick" # this one feels obvious but that saves me so many letters
---fzf_prompt.sh---
#!/usr/bin/env bash
branch=$(git for-each-ref --shell --format='%(refname)' refs | cut -d/ -f3- | grep -Eo "[^']+" | fzf-tmux -d 15);
if [[ ! -z "$branch" ]]; then
if [[ $branch == origin/* ]]; then
branch=$(echo $branch | cut -d/ -f2-)
fi
git checkout "$branch"
fi
- wlonkly 3y agoI have to ask -- why cheese-touch?
- from-nibly 3y agoIt's from the book diary of a wimpy kid. In the book there is some gross cheese on the street and someone is dared to touch it. Once they touch it they become an outcast, obtain the "cheese touch" and no one wants to talk to them. However once they touch someone else the "cheese touch" transfers to that someone else freeing the original person from being an outcast. So cheese touch is the last person to touch that file. Every time someone touches the file the cheese touch transfers. And if that file broke the build or something you can find out who has the cheese touch on that file and t̶r̶e̶a̶t̶ ̶t̶h̶e̶m̶ ̶l̶i̶k̶e̶ ̶a̶n̶ ̶o̶u̶t̶c̶a̶s̶t̶ ask them nicely if they know what's happening.
- wlonkly 3y agoWell now I have a new alias to add!