Use double-quotes on creating new Git repo on Windows
by Andy Sylvester Friday, April 22, 2016

I am working on a new project, and got to the point where I was ready to start doing some version control. I am using the Github app on my Windows laptop, and thought I would try to use that to set up my new repo, but it seemed like it was not giving me a chance to add the new files to the repo, it would only create a repo. I then tried to create a Git repo from the command line, and spent a while trying to find the right commands to add all the files in the folder (I will give the command list in a minute). My final problem was that when I did the commit, I got an error saying:

error: pathspec commit'' did not match any file(s) known to git.

After some more searching, I found that on Windows, the commit string has to use double-quotes. Arrrgh! Why does the Git book not mention this? In addition, the Git book did not give me a list of the commands I was looking for. I remember it used to have such a list. Sigh...

After I created the repo, I was then able to add the repo to my Github app by navigating to the .git folder within the repo folder. Whew! Now I can get on with my work!

For future reference, here is the list of commands I used to create a repo from a folder with files and folders already present:

cd project_folder

git init

git add *

git commit -m “Initial commit”