Any help would be great. Thanks in advance!
I have git installed, and the ssh key setup, but I'm getting this weird error.
admin@Administrators-MacBook-Pro:~/Desktop$ cd exercise/
admin@Administrators-MacBook-Pro:~/Desktop/exercise$ git init
Initialized empty Git repository in /Users/admin/Desktop/exercise/.git/
admin@Administrators-MacBook-Pro:~/Desktop/exercise$ git remote add origin [email protected]:pavankat/exercise.git
admin@Administrators-MacBook-Pro:~/Desktop/exercise$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:pavankat/exercise.git'
admin@Administrators-MacBook-Pro:~/Desktop/exercise$ git push [email protected]:pavankat/exercise.git HEAD:test
fatal: remote part of refspec is not a valid name in /
admin@Administrators-MacBook-Pro:~/Desktop/exercise$ git push [email protected]:pavankat/exercise.git HEAD:test
error: src refspec HEAD does not match any.
error: failed to push some refs to '[email protected]:pavankat/exercise.git'
admin@Administrators-MacBook-Pro:~/Desktop/exercise$
The “src refspec master does not match any” error occurs if you have forgotten to add the files you have changed to a commit and try to push those changes to a remote repository before you make the first commit in your repository.
Whenever we need to push the changes to a remote repository, we use git push along with the remote repository “origin” and “master” branches. The term used is “git push origin master“. To pull the changes from the remote repository to local, we use git pull along with remote repository “origin” and “master” branch.
Git Push Origin pushes all the branches to the main branch. Git Push Origin Master pushes your master branch to the origin. Command for this: git push origin.
The steps to follow in order to push new Git branches to remote repos such as GitHub, GitLab or Bitbucket are as follows: Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch.
so i didn't do
git add .
git commit -am 'initial commit'
before I pushed.
:/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With