git/list[1] front-page[2] threads[3] people[4] search[5] about
 

glob escaping doesn't work with git mv

From
AGAlan Grover <alan.grover@gmail.com>
Date
Aug 7, 2014, 01:52 UTC
Message-ID
<CA+cJFMm_vJwk=D0dkhEvfXwWk1S74hONb_g7O9W0iMZD3yAdLg@mail.gmail.com>

I tried using escaped globs with git mv, but globs don't seem to be expanded with git mv.

So, for example, I've got files file1 & file2, and have been editing them, so I've got file1~ and file2~ also, and *~ is in .gitignore.

If I do:

$ mkdir newdir $ git mv file* newdir

I get a 'fatal: not in repository' error because I'm trying to move untracked files.

Since we can do git add file\*, I tried:
$ git mv file\* newdir

I get a 'bad source, source=file* destination=file*' error. It seems to be looking for a file named 'file*' rather than performing glob expansion.

If I do:

$ rm *~ $ git mv file* newdir

Everything works as expected. It would be convenient if git mv expanded escaped globs.

Thanks!
Next: Duy Nguyen
Message 1 of 2 in “glob escaping doesn't work with git mv”
  1. Alan GroverAug 7, 2014
  2. Duy NguyenAug 7, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.