GitHub上傳文件問題總結


問題一:git warning: LF will be replaced by CRLF in 解決辦法

在Git Bash中輸入git add .時出現上述語句。

解決辦法:

輸入以下語句:

1 $ git config core.autocrlf false

,這樣設置git的配置后在執行add操作就沒有問題了。

 

問題二:On branch master nothing to commit, working tree clean

在Git Bash中輸入 git commit -m " " 時出現下列語句:

On branch master nothing to commit, working tree clean

On branch master nothing to commit, working tree clean

含義是:項目沒有被修改,不需要提交。也就是說:修改->add->修改->commit只能commit已經add的修改。

問題解決:

若要保存第二次修改需要再一次add然后commit

 

問題三:fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

在Git Bash中輸入 git commit -m " " 時出現下列語句:

fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

解決辦法:

輸入以下語句:

1 $ chmod 664 COMMIT_EDITMSG

問題四:fatal: the remote end hung up unexpectedly

在輸入git push origin master之后出現fatal: the remote end hung up unexpectedly ,表示上傳文件太大,導致上傳失敗。

解決辦法:

參考博客:https://www.cnblogs.com/hanxianlong/p/3464224.html

問題五:fatal: refusing to merge unrelated histories

在輸入下拉語句 git pull origin master之后出現fatal: refusing to merge unrelated histories,這個問題是因為這是兩個不想干的Git庫,一個是本地庫,一個是遠端庫,然后本地與遠端不相干,所以告知無法合並。

解決辦法:

使用強制方法:

1 git pull origin master --allow-unrelated-histories

后面加上 --allow-unrelated-histories ,參數的意思是合並倉庫的時候,允許不相關的歷史的提交內容,后面再push就可以了 。


免責聲明!

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



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