Why am I getting the message, “fatal: This operation must be run in a work tree?”

前端 未结 15 756
野趣味
野趣味 2020-11-27 12:33

Just installed git on Windows. I set the GIT_DIR variable to be c:\\git\\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it

相关标签:
15条回答
  • 2020-11-27 13:27

    In my case, I was in the same folder as ".git" file for my repo. I had to go one directory level up, it solved it.

    0 讨论(0)
  • 2020-11-27 13:27

    If an existing (non-bare) checkout begins giving this error, check your .git/config file; if core.bare is true, remove that config line

    0 讨论(0)
  • 2020-11-27 13:28

    Same issue i got, i did following steps,

    1. git init
    2. git add .
    3. git commit -m"inital setup"
    4. git push -f origin master

    then it work starts working.

    0 讨论(0)
提交回复
热议问题