Post

Fed up of the git checkout & pull dance, especially when you have repos that don't agree on master/main/next as your default? Here's an alias: ``` git config --global alias.sm '!f() { git switch $(git remote show $(git remote | head -n 1) | sed -n "/HEAD branch/s/.*: //p") && git pull; }; f' ```

0 reposts1 like