Skip to content

Commit 36a362f

Browse files
committed
Update .bash_aliases
1 parent 629f152 commit 36a362f

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

.bash_aliases

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,75 @@ alias rehome_undo="git restore --staged dotfiles && git restore dotfiles && git
1515
# described by the README. For any additional aliases I use, I've added them
1616
# only in https://github.com/Skenvy/dotfiles/blob/home/.bash_aliases my home.
1717

18+
# For using this repo as $HOME on Windows+WSL
19+
alias wsl_resym_ssh="( shopt -s dotglob; WINDOWS_PATH=\"/mnt/c/Users/\$LOCAL_WINDOWS_USERNAME/\"; for f in \$WINDOWS_PATH.ssh/*; do grep -qx \"\$(tracking)\" <<< \"\${f/\$WINDOWS_PATH/}\" && echo \"TRACKED FILE NOT SYM'd \$f\" || (echo \"UNTRACKED WILL BE LINKED \$f\" && ln -sf \"\$f\" ~/\${f/\$WINDOWS_PATH/}); done )"
20+
21+
################################################################################
22+
# Main things
23+
24+
# The only right way to ls
1825
alias gg="ls -liath"
26+
# Pretty print the PATH
1927
alias yellow_brick_road="echo \$PATH | tr ':' '\n'"
28+
# Git shell if you hate yourself lol
2029
alias gsh="perl -nE 'BEGIN {print \"git (CTRL+D to quit)> \"} system \"git \$_\"; print \"git (CTRL+D to quit)> \"'"
21-
# alias start_iterm_from_here="pwd > ~/.iterm2/initdir"
2230

23-
# For using this repo as $HOME on Windows+WSL
24-
alias wsl_resym_ssh="( shopt -s dotglob; WINDOWS_PATH=\"/mnt/c/Users/\$LOCAL_WINDOWS_USERNAME/\"; for f in \$WINDOWS_PATH.ssh/*; do grep -qx \"\$(tracking)\" <<< \"\${f/\$WINDOWS_PATH/}\" && echo \"TRACKED FILE NOT SYM'd \$f\" || (echo \"UNTRACKED WILL BE LINKED \$f\" && ln -sf \"\$f\" ~/\${f/\$WINDOWS_PATH/}); done )"
31+
################################################################################
32+
# Git (simple)
2533

26-
# Git
34+
# Print the log as "Tree Hash | Commit Hash | Parent Hash(es)"
2735
alias yikes="git log --pretty=format:\"%T | %H | %P\""
28-
alias quack="git diff \$(git merge-base \$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) HEAD).. --stat"
29-
alias honk="git diff \$(git merge-base \$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) HEAD).."
36+
# Print the full config diagnostic
37+
alias gvconf="git config --list --show-origin --show-scope"
38+
# What files are being tracked here?
39+
alias tracking="git ls-tree --full-tree --name-only -r HEAD"
40+
# Remove a hook if you've been snagged by one.
41+
alias unhook="git config --unset core.hookspath"
42+
43+
# If a branch name is hella long and you cbf manually copy pasting use these to swap context
44+
# idk I was really hungry when I wrote them and about to go buy a McAngus for lunch, don't @ me.
45+
alias cook_mcangus="CURR_BRANCH=\$(git branch -a | grep \* | cut -d ' ' -f2) && echo \"\\\$CURR_BRANCH = \$CURR_BRANCH\""
46+
alias eat_mcangus="git checkout \$CURR_BRANCH"
47+
48+
################################################################################
49+
# Git (rev-parse --abbrev-ref origin/HEAD) edition
50+
3051
# If "git rev-parse --abbrev-ref origin/HEAD" in the following fails,
3152
# use "git ls-remote --symref origin HEAD" to verify the remote HEAD,
3253
# and if it's ok, re-run "git remote set-head origin --auto" to fix.
54+
55+
# to get a smol (--stat) diff to the trunk, or a full diff.
56+
alias quack="git diff \$(git merge-base \$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) HEAD).. --stat"
57+
alias honk="git diff \$(git merge-base \$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) HEAD).."
58+
59+
# use this when you aren't currently on the trunk to update it without swapping off your current branch
3360
alias pull_trunk="__=\$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) && git fetch origin \$__:\$__"
61+
# use this when you want to "be on and ..." update only the trunk branch
62+
alias checkout_trunk_head="__=\$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) && git checkout \$__ && git fetch --update-head-ok origin \$__:\$__ && git reset --hard HEAD"
63+
3464
alias merge_trunk="__=\$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) && git fetch origin \$__:\$__ && git merge \$__"
3565
alias merge_trunk_squash_theirs="__=\$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f 2) && git fetch origin \$__:\$__ && git merge --squash -X theirs \$__"
36-
alias cook_mcangus="CURR_BRANCH=\$(git branch -a | grep \* | cut -d ' ' -f2) && echo \"\\\$CURR_BRANCH = \$CURR_BRANCH\""
37-
alias eat_mcangus="git checkout \$CURR_BRANCH"
38-
alias unhook="git config --unset core.hookspath"
39-
alias gvconf="git config --list --show-origin --show-scope"
40-
alias tracking="git ls-tree --full-tree --name-only -r HEAD"
4166

67+
################################################################################
4268
# Docker
69+
4370
alias yeet="docker run --rm -it ubuntu"
4471
alias bezos="docker run -it --rm amazonlinux bash"
4572
alias MLG="docker run -it --rm fedora bash"
73+
74+
alias snek13="docker run -it --rm python:3.13-slim bash"
75+
alias snek12="docker run -it --rm python:3.12-slim bash"
4676
alias snek11="docker run -it --rm python:3.11-slim bash"
47-
alias snek10="docker run -it --rm python:3.10.15-slim bash"
77+
alias snek10="docker run -it --rm python:3.10-slim bash"
4878
alias snek9="docker run -it --rm python:3.9-slim bash"
4979
alias snek8="docker run -it --rm python:3.8-slim bash"
5080

81+
################################################################################
5182
# Other
5283
alias venv="deactivate 2> /dev/null; python3 -m venv .ve; env; pip3 install --upgrade pip; pip install --upgrade pylama==7.7.1 pylint wheel"
5384
alias env="deactivate 2> /dev/null; source .ve/bin/activate 2> /dev/null"
85+
# If you're on a Mac using iterm2 with settings that cd to restart it from a location read from a file...
86+
alias start_iterm_from_here="pwd > ~/.iterm2/initdir"
5487
alias tfff="terraform fmt -check -diff -recursive"
5588
alias hello="cowsay -f dragon Hello"
5689

0 commit comments

Comments
 (0)