threads / discuss / 65485

git fetch second argument parsing inconsistency

Subject: git fetch second argument parsing inconsistency

## tl;dr

One message between Apr 15, 2026 and Apr 15, 2026.

replies: 0people: 1as markdown or json

Alix Brunet· Apr 15, 2026, 00:05 UTC · lore
Hello team.

I just "discovered" that the git fetch second argument parsing is inconsistent

`git fetch <url>` silently fails, but `git fetch <url> ""` fetches the default branch

I quoted "discovered" because imagine this might have been discovered before, but it took me too long to figure out, and the docs page ( https://git-scm.com/docs/git-fetch ) doesn't mention it either.

I figure this is either an unwanted behavior, an error that should not be silent, or at the very least something that needs documentation.

Sincerely, Malix - https://github.com/Malix-Labs

← back to recent threads