From: Kirill Likhodedov Date: Sat, 06 Feb 2016 13:16:35 GMT Subject: git show doesn't work on file names with square brackets Message-ID: <6A7D4447-AC25-4591-9DA7-CD153198EC64@jetbrains.com> I’ve faced a problem that `git show :` returns an error when contains square brackets. Interestingly, the problem is reproducible on "GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)", but not on "zsh 5.0.7 (x86_64-pc-linux-gnu)”. The problem is also reproducible when called from a Java program by forking a process with given parameters. Is it a bug or I just didn’t find the proper way to escape the brackets? Steps to reproduce: git init brackets cd brackets/ echo ‘asd’ > bra[ckets].txt git add bra\[ckets\].txt git commit -m initial git show HEAD:bra[ckets].txt Error: fatal: ambiguous argument 'HEAD:bra[ckets].txt': both revision and filename Use '--' to separate paths from revisions, like this: 'git [...] -- [...]’ Neither escaping, not quoting doesn’t help: git show HEAD:bra\[ckets\].txt returns the same error git show "HEAD:bra\[ckets\].txt” returns empty output Thanks a lot! -- Kirill