git將本地內容傳送到遠程倉庫出現![rejected] master -> master (fetch first)錯誤


問題:使用git push -u 遠程庫名 master 命令將本地提交的內容傳到git遠程庫時出現錯誤:

命令: git push -u origin master

出現錯誤:
  To https://github.com/imjinghun/university.git
  ! [rejected] master -> master (fetch first)
  error: failed to push some refs to 'https://github.com/imjinghun/university.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.


解決:使用 git push -f 命令重新傳一遍就可以成功了

命令:git push -f

結果:
  Counting objects: 5739, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (5341/5341), done.
  Writing objects: 100% (5739/5739), 205.84 MiB | 40.00 KiB/s, done.
  Total 5739 (delta 1847), reused 0 (delta 0)
  remote: Resolving deltas: 100% (1847/1847), done.
  remote: warning: GH001: Large files detected. You may want to try Git Large File
  Storage - https://git-lfs.github.com.
  remote: warning: See http://git.io/iEPt8g for more information.
  remote: warning: File ed5d681ab7d6af5905bcbae56de9ee0477d9ef3b is 60.34 MB;
  this is larger than GitHub's recommended maximum file size of 50.00 MB
  To https://github.com/imjinghun/university.git
  + cd5b93f...83b3d6c master -> master (forced update)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM