Currently, git bash in windows pointing to vikas@VIKAS-PC /D/code/myrepo (master)
I ran following git commands:
$ git config --global user.name "Vikas Sharma"
$ git config --global user.email "vikas.sharma.in@gmail.com"
git init
git add .
git commit -m "initial commit"
$ git status
On branch master nothing to commit (working directory clean)
Now, “git remote” command returns nothing. I was expecting origin repo.
So, i created origin repo as shown below:
$ git remote add origin D:/code/myrepo
$ git push origin "some-external-repo"
But, getting below error:
error: src refspec myrepo does not match any.
error: failed to push some refs to 'D:/code/myrepo'
finally, I am able to resolve it.
I mistakenly thought that below command will create local repository with name “origin”:
$ git remote add origin D:/code/myrepo
However, later I realised that “master” is the name of local repository. we don’t need to create them explicitly.
now, below command works for me:
$ git push “some-external-repo” master
Thanks anonfunc for helping me on this.