git reset asks 'more?'

后端 未结 3 1597
忘了有多久
忘了有多久 2020-12-04 20:47

Git windows command line, version 1.8.0

I have 3 commits so far and when I type

git reset --soft HEAD^

new line comes up with

3条回答
  •  一向
    一向 (楼主)
    2020-12-04 21:15

    Your shell is interpreting the ^ symbol as a line continuation symbol. Either just avoid using ^ as Adam suggests:

    git reset --soft HEAD~1
    

    or quote the argument so the shell doesn't attempt to interpret it (I'm not sure exactly which shell you're using, but I'd be surprised if this doesn't work):

    git reset --soft "HEAD^"
    

提交回复
热议问题