I can commit individual files within the directory, but it will not allow me to commit the whole directory.
Asked
Active
Viewed 52 times
1 Answers
4
You need to be in that folder for the git commit
to work.
And you need to add it first
This wouldn't work:
git init test
git add test
git commit -m "add test"
This would work:
git init test
cd test
git add .
git commit -m "add test"
You can check if the folder is part of a repo:
cd test
git rev-parse --git-dir
Make sure no environment variable like GIT_DIR
is defined (which would make the git command look for a git repo elsewhere)