我被困在這段代碼中。在git fetch之後,我遇到了一堵牆,不知道下一步應該如何將所有提交的文件都放到GitHub服務器上 - 現在只有一個文件README.md在保存新存儲庫時自動創建。感謝幫助。GitBash |起源大師 - 拒絕(首先獲取)| GitHub存儲庫中沒有文件
Freeware [email protected] MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git status
On branch master
nothing to commit, working tree clean
Freeware [email protected] MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git remote add origin https://github.com/adambugaj/Lets-code.git
Freeware [email protected] MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git push -u origin master
To https://github.com/adambugaj/Lets-code.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/adambugaj/Lets-code.git'
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.
Freeware [email protected] MINGW64 ~/Desktop/Coding Staff/MustBeDone (master)
$ git fetch origin master
warning: no common commits
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/adambugaj/Lets-code
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
可能重複的[git:更新被拒絕,因爲遠程包含本地沒有的工作](https://stackoverflow.com/questions/24357108/git-updates-were-rejected-because-the-remote-contains-work-that-do-not-have) – phd