From: Kirill Likhodedov Date: Sat, 06 Feb 2016 14:29:20 GMT Subject: Re: git show doesn't work on file names with square brackets Message-ID: <25D155FA-6F05-425C-AB2D-7F0B44E0D1C5@jetbrains.com> In-Reply-To: Hi Johannes, thanks for your answer, but unfortunately it doesn’t help. > On 06 Feb 2016, at 17:21 , Johannes Schindelin wrote: > > This is expected behavior of the Bash you are using. The commands that I > think would reflect your intentions would be: > > 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’ Nope. This command sequence doesn’t work for me: the same error is returned: # git show 'HEAD:bra[ckets].txt' fatal: ambiguous argument 'HEAD:bra[ckets].txt': both revision and filename > You could also escape the brackets with a backslash, as you did, but you > would have to do it *every* time you write the path, not just in the `git > add` incantation. As I mentioned at the end of my original message, escaping doesn't help either. `git add` works fine both with and without escape. It was auto-completed by bash completion, and I just forgot to remove the backslashes before pasting the code here. At any case, escaping doesn’t work with `git show`.