211 views
0
Technology 211 views

Useful GIT alias commands

codalatatest
2026-10-26 08:21:24
l = log --graph --abbrev-commit --decorate --pretty=format:'%C(auto)%h %d %s %C(black)%C(bold)%cr' --all a = add ap = add -p c = commit --verbose ca = commit -a --verbose cm = commit -m cam = commit -a -m m = commit --amend --verbose d = diff ds = diff --stat dc = diff --cached s = status -s bigstatus = status -b -v -v co = checkout cob = checkout -b qpush = !"msg=${1:-wip}; git add -A && git commit -m \"$msg\" || true; git push" # list branches sorted by last modified b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'" # list aliases la = "!git config -l | grep alias | cut -c 7-" pullhere = "!f(){ for d in */.git; do (cd \"${d%/.git}\" && echo \"Updating ${d%/.git}\" && git pull); done; }; f" pullmain = "!f(){ for d in */.git; do (cd \"${d%/.git}\" && echo \"Updating ${d%/.git}\" && if git show-ref --verify --quiet refs/heads/main || git show-ref --verify --quiet refs/remotes/origin/main; then git checkout main; else git checkout master; fi && git pull); done; }; f" pulltest = "!f(){ for d in */.git; do (cd \"${d%/.git}\" && echo \"Updating ${d%/.git}\" && if git show-ref --verify --quiet refs/heads/test || git show-ref --verify --quiet refs/remotes/origin/test; then git checkout test; else git checkout test2; fi && git pull); done; }; f" pulldevelop= "!f(){ for d in */.git; do (cd \"${d%/.git}\" && echo \"Updating ${d%/.git}\" && if git show-ref --verify --quiet refs/heads/develop || git show-ref --verify --quiet refs/remotes/origin/develop; then git checkout develop; else git checkout develop2; fi && git pull); done; }; f" pullall = "!git pullmain; git pulltest; git pulldevelop" nuke = !git branch | grep -v \"develop\" | grep -v \"master\" | grep -v \"main\" | grep -v \"test\" | xargs git branch -D nukeall = "!f(){ for d in */.git; do (cd \"${d%/.git}\" && echo \"Nuking ${d%/.git}\" && git branch --format='%(refname:short)' | grep -Ev '^(master|main|test|develop)$' | while IFS= read -r branch; do git branch -D \"$branch\"; done); done; }; f" nukeworktrees = "!f(){ for d in \"$HOME\"/source/worktrees/*; do [ -d \"$d\" ] || continue; repo=$(git -C \"$d\" rev-parse --path-format=absolute --git-common-dir 2>/dev/null) || continue; branch=$(git -C \"$d\" symbolic-ref --quiet --short HEAD 2>/dev/null); echo \"Removing $d\"; git --git-dir=\"$repo\" worktree remove --force \"$d\"; git --git-dir=\"$repo\" worktree prune; if [ -n \"$branch\" ] && ! git --git-dir=\"$repo\" worktree list --porcelain | grep -Fxq \"branch refs/heads/$branch\"; then git --git-dir=\"$repo\" branch -D \"$branch\"; fi; done; }; f" diffnew = diff HEAD~1 HEAD
Log in to comment

Comments (2)

Top

codalatatest 2026-10-27 09:09:36

$ netsh wlan show interfaces There is 1 interface on the system: Name : Wi-Fi Description : NETGEAR A6100 WiFi Adapter GUID : 30efeffe-3075-4982-9f3d-fb9afaea6f93 Physical address : 38:94:ed:14:e1:f3 State : connected SSID : DarthCuzGuest BSSID : a2:e7:ae:41:4c:a1 Network type : Infrastructure Radio type : 802.11n Authentication : WPA2-Personal Cipher : CCMP Connection mode : Profile Channel : 1 Receive rate (Mbps) : 86.7 Transmit rate (Mbps) : 86.7 Signal : 100% Profile : DarthCuzGuest Hosted network status : Not available
0

codalatatest 2026-10-27 09:12:29

$ netsh wlan show interfaces There is 1 interface on the system: Name : Wi-Fi Description : NETGEAR A6100 WiFi Adapter GUID : 30efeffe-3075-4982-9f3d-fb9afaea6f93 Physical address : 38:94:ed:14:e1:f3 State : connected SSID : DarthCuz BSSID : a0:e7:ae:41:4c:a0 Network type : Infrastructure Radio type : 802.11n Authentication : WPA2-Personal Cipher : CCMP Connection mode : Profile Channel : 1 Receive rate (Mbps) : 86.7 Transmit rate (Mbps) : 86.7 Signal : 100% Profile : DarthCuz Hosted network status : Not available
0