git-commitgit-refspec

Laravel + Angular project commit error: src refspec master does not match any


There is a project that is coded using angular and laravel. I downloaded it from server to my local. After doing some cleaning, tried to commit to git. But I see the same error everytime which I specified on header. After some tests, when I was looking here for the same errors, I couldn't find any solution. There are my steps:

   1. cd sysGarden
   2. git init
   3. git add .
   4. git commit -m "first commit"
   5. git remote add origin git@github.com:biyro02/sysGarden.git
   6. git push -u origin master

After the last step I saw errors. I have an account on github. You can look: https://github.com/biyro02/sysGarden On git bash, I have logged in with my user name and password. Everything ok but I see errors. Please help me. This is my first git commit. I am ready to share my all infos. Just, I want to exceed this problem.

Edit: I execute "git branch" result: * master

Edit 2: I got the error below:

   git@github.com: Permission denied (publickey).
   fatal: Could not read from remote repository.

   Please make sure you have the correct access rights
   and the repository exists

Solution

  • You should be able to resolve this issue by running the following commands again.

    git add .
    git commit -m 'Commit Message Here'
    git push -u origin master 
    

    You may also try git push origin HEAD:master and if you need more information to share you can try git show-ref to see more verbose your local branch information.

    This issue likely happens because of unstaged / untracked files or because your current branch is different to the branch you are pushing but I cannot be certain.