0

I want to pysh my project to a github repository called luna.git:

I followed the instructions echo “# luna” >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/raouiyounes/luna.git git push -u origin master

But I get this error

error: src refspec master does not match any.
error: impossible de pousser des références vers ‘https://github.com/raouiyounes/luna.git’
Younès Raoui
  • 211
  • 5
  • 10
  • Possible duplicate of [src refspec master does not match any when pushing commits in git](https://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git) – Preston Martin Sep 18 '17 at 15:12

2 Answers2

1

Maybe you just need to commit.

Try this:

git add .
git commit -m "initial commit"
git push origin master
Wilson Vargas
  • 2,841
  • 1
  • 19
  • 28
  • error: src refspec master does not match any. error: impossible de pousser des références vers 'https://github.com/raouiyounes/luna.git' – Younès Raoui Sep 18 '17 at 15:11
  • The most probable reason for this error is that all the files are untracked and have not been added. `git add --all` in case you wish to add all the files Or you can selectively add files. Then `git commit -m "Initial comment"`, `git push origin master`. This will surely work. – Wilson Vargas Sep 18 '17 at 15:14
  • Thanks it works.But there are some file which are not pushed. Is there any limit on the size of the project ? – Younès Raoui Sep 18 '17 at 15:17
  • Use `git add *` or `git add .` to add all files in a directory. If this helped you mark like answer please. – Wilson Vargas Sep 18 '17 at 15:20
0

You can do :

git push origin HEAD:branch-name
Adrien Parrochia
  • 785
  • 8
  • 10