“git add” returning “fatal: outside repository” error

前端 未结 10 2023
情话喂你
情话喂你 2021-01-31 16:34

I\'m just entering into the wonderful world of git. I have to submit a bunch of changes that I\'ve made on my program, located in a directory called /var/www/myapp

10条回答
  •  花落未央
    2021-01-31 17:16

    My scenario is that the git repository's path has symbolic link and git throw out this error when add file say to "/home/abc/GIT_REPO/my_dir/my_file". and "/home" is actually a softlink to "/devhome".

    code ninja gave me some light when I tried to debug this case.

    So I tried get the target directory by using the command readlink -f /home/abc/GIT_REPO before run add command.

    And then everything works like a charm !

提交回复
热议问题