error: src refspec master does not match any. 1

error: src refspec master does not match any.

# You are trying to add an empty repository, add something first, like a readme
touch README.md
git add README.md
git commit -m "Initial commit"
git push --set-upstream origin master

Here is what the above code is Doing:
1. Create a new directory
2. Change into that directory
3. Initialize a new git repository
4. Add a new file
5. Commit the file
6. Add the remote repository
7. Push the changes to the remote repository
8. Set the upstream branch

Similar Posts