Last active
March 6, 2023 10:47
-
-
Save VeikkoLehmuskorpi/189a55ecb120c7e3da01e33968f37d00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Track and checkout a remote branch with fzf | |
| git fetch | |
| branch=$(git for-each-ref refs/remotes/origin --format='%(refname:short)'|fzf) | |
| if [ -n "$branch" ]; then | |
| git checkout -t "$branch" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment