1

While I am trying to do git add for a folder or for all files, I am getting the fatal error as shown below.

MINGW64 /c/xampp/htdocs/d95x-dev (master)
$ git add /vendor
fatal: C:/Program Files/Git/vendor: 'C:/Program Files/Git/vendor' is outside repository at 'C:/xampp/htdocs/d95x-dev'

It is automatically adding this path C:/Program Files/Git/ in front of the folder name that I am trying to add.

Why is it doing this?

My folder is at the path C:/xampp/htdocs/d95x-dev, how can I tell git add to add C:/xampp/htdocs/d95x-dev/vendor instead?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • You meant `vendor` or `vendor/` or `./vendor`, not `/vendor`. – mkrieger1 Jul 24 '22 at 08:50
  • @mk yes, Thanks it should be vendor or vendor/ but my main issue here is that, the path C:/Program Files/Git/ is getting added to the folder name for some reason – ASHISH SINGH Jul 24 '22 at 09:02
  • @mk yes, Thanks again, actually after adding it by writing the `git add vendor` it the way you said it also helped with that issue of path. – ASHISH SINGH Jul 24 '22 at 09:40

1 Answers1

0

Try

git add vendor/

Or, You can also add all the files using

git add .
Sidharth Mudgil
  • 1,293
  • 8
  • 25