We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3511bff commit 3e587e4Copy full SHA for 3e587e4
1 file changed
git-open.zsh
@@ -22,8 +22,13 @@ trim() {
22
}
23
24
git_get_remote() {
25
- remote=$(git remote -v | grep "(push)" | awk '{print $2}')
26
- echo $remote
+ remote=$(git remote -v | grep "(push)" | awk '{print $1, $2}')
+ # Prefer "origin" remote if available, otherwise use the first one
27
+ selected=$(echo "$remote" | grep "^origin " | head -1 | awk '{print $2}')
28
+ if [[ -z "$selected" ]]; then
29
+ selected=$(echo "$remote" | head -1 | awk '{print $2}')
30
+ fi
31
+ echo $selected
32
33
34
git_get_repo_path() {
0 commit comments