Skip to content

Commit 447c89a

Browse files
authored
Merge pull request #1981 from william-richard/make-default-branch-match-exactly-main
Look for branches that are literally the word main
2 parents 7b4056f + 2a23598 commit 447c89a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aliases/available/git.aliases.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function gdv() {
199199
}
200200

201201
function get_default_branch() {
202-
if git branch | grep -q main; then
202+
if git branch | grep -q '^. main\s*$'; then
203203
echo main
204204
else
205205
echo master

0 commit comments

Comments
 (0)