While working in Github,I was trying to push my code in my Github repository.After deleting all files from repo,I tried to push the new code.But I encounter with given below Error:
error: src refspec master does not match any.
error: failed to push some refs to ‘https://github.com/sharadchhetri/sharadchhetri.github.io’
To solve this error,run the below given command
git add . git commit -m 'write your message' git push origin source --force
Below is the reference of my troubleshooting
sharad@localhost:/opt/sharadchhetri.github.io$ git push origin master Username for 'https://github.com': user@example.com Password for 'https://user@example.com@github.com': error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/sharadchhetri/sharadchhetri.github.io' sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ git show-ref d90e1b91071539ddf90ee2b69f3404c3dbfcfb99 refs/heads/source 5a6b8e4352f25aa65e2dafeec2fa8f506d0830fa refs/remotes/octopress/2.5 277f70271f022dfd277275b59f5baecdff5965a6 refs/remotes/octopress/2.5-simplify-rakefile 0b44a79a51d0fe96ffd8138cb4a62d9307569b85 refs/remotes/octopress/3.0 8f51bdc0fd0323c4a6bd9fd645f3abb73baccd08 refs/remotes/octopress/HEAD d4896764ed3bc757f3ab617c70daf85f2356d85a refs/remotes/octopress/commander 43810533b491802805f4493c03f0a52dfc3abbac refs/remotes/octopress/gh-pages 7bdab0e65c86d8bd9fe3b46a4bf1ca92b1e1a54e refs/remotes/octopress/guard fc73997a5d4e3c76037985749b0ccc48ae69fa5c refs/remotes/octopress/jekyll-1-3 1750830c63aacc13fce85b7e4de53541c024ccef refs/remotes/octopress/linklog 8f51bdc0fd0323c4a6bd9fd645f3abb73baccd08 refs/remotes/octopress/master 9b599404c7f14fc37f24f887cfb337d5d47ad38e refs/remotes/octopress/migrator 8fe52e18bc65dbebe3b6bcc93267fb81325aff88 refs/remotes/octopress/refactor_with_tests 9f54cbd0f7dcaa6224ba03fb98e705b138530976 refs/remotes/octopress/rubygemcli 53b2df0231df45c1225da94f9fc985eee5f794df refs/remotes/octopress/site 98bd6c9bceb9e9c63451cc736628ff0e2d58a2af refs/remotes/octopress/site-2.1 c24852e3840cd679c56d994c6e3ff2651e19d2ea refs/remotes/origin/master 5bd0566e3b9f849720dc4472faacebb0848be9b7 refs/remotes/origin/source 292a6d563efb51be1ae34af36252a0a604763972 refs/tags/v2.0 sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ sharad@localhost:/opt/sharadchhetri.github.io$ git push origin master --force Username for 'https://github.com': user@example.com Password for 'https://user@example.com@github.com': Counting objects: 12, done. Delta compression using up to 2 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (8/8), 1.73 KiB | 0 bytes/s, done. Total 8 (delta 4), reused 1 (delta 1) To https://github.com/sharadchhetri/sharadchhetri.github.io + 5bd0566...d90e1b9 master -> master (forced update) sharad@localhost:/opt/sharadchhetri.github.io$