I can neither find my files in my local repository nor in github repository after I did some commands in linux command line. Here is the command that I've used.
$ git init
$ git config user.name 4everZard
$ git config user.email bryanwu610@gmail.com
$ git add *
$ git commit -m 'First commit'
$ git remote add origin https://github.com/4everZard/pdfeditor
$ git remote -v
$ git push origin master
and here is the info I get from the terminal :
Username for 'https://github.com': 4everZard
Password for 'https://4everZard@github.com':
To https://github.com/4everZard/pdfeditor
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/4everZard/pdfeditor'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
After I've done this, I can't find my files anymore. I'm totally fresh to github, please help! Thanks:)
edit: Problem has been solved. This problem is due to that I created another HEAD, so that origin head became detached head. Once I realize that, I create a new temporary HEAD and pull it back to origin master, then everything solved. Thank you everyone.
some links may help to those meet the same problem: How can I reconcile detached HEAD with master/origin?
Github "Updates were rejected because the remote contains work that you do not have"