0

I first navigated to the correct directory in Git Bash (desktop where I had saved my file) and typed in the following after the $: git add HelloWorld.md

Git Bash's response is fatal: Not a git repository (or any of the parent directories): .git I tried moving the file to Documents got the same message What am I doing wrong?

Nancy Wahl
  • 11
  • 1
  • 2

2 Answers2

0

Make sure you have done

git init

and you see the .git file

Keheira
  • 90
  • 1
  • 10
0

Assuming that all you've done is navigate to the file you wish to upload and typed git add myfile, that won't actually work. There's a small process you have to go through to set up a git directory in a given folder.

Step 1: git init in the directory you plan on pushing to github.

Step 2: git add . to add all files or git add yourFile for one file

Step 3: git commit -m "first commit" to commit your additions

Step 4: git remote add origin your_remote_repository_url to link it

Step 5: git remote -v to verify

Step 6: git push origin master to upload it to github for good