Search code examples
gitzshgit-fetch

How to correctly fetch git notes with zsh?


Recently vagrant image i use switched to zsh and i can't get git notes from remote with it. I try:

git fetch origin refs/notes/*:refs/notes/*

And get:

zsh: no matches found: refs/notes/*:refs/notes/*

What is the correct command then?


Solution

  • zsh sees the asterisks in your command, thinks its a glob and tries to expand it, but there are no files that match the pattern, so it fails. If you wrap the argument in single quotes, it won't try to expand the glob and the argument will be passed as expected:

    git fetch origin 'refs/notes/*:refs/notes/*'