Posh-git: git reset HEAD@{1} results in error

Created on 13 Jul 2013  路  10Comments  路  Source: dahlbyk/posh-git

I issued the command git reset HEAD@{1} and I got the following message

error: unknown switch `e'

The same command works fine from Git Bash

Most helpful comment

That's because curly braces have special meaning in PowerShell. You can either surround with single quotes or escape with backtick. For example:

git reset 'HEAD@{1}'

All 10 comments

That's because curly braces have special meaning in PowerShell. You can either surround with single quotes or escape with backtick. For example:

git reset 'HEAD@{1}'

ah, good point. thanks

+1

@JayBazuzi, you're a lifesaver.

+1

@JayBazuzi Thank you!

Will there be a resolution for this in posh-git or do we always have to omit those with single quotes?

@JawadS this is an issue with PowerShell, not posh-git.

Hmm, Such a shame, I enjoyed using posh but a few issues like these forced me to switch back to git-bash

@JawadS - I think it makes sense to use whatever works best for you. I like poshgit and haven't found it limiting.

Was this page helpful?
0 / 5 - 0 ratings