git push? Everything up-to-date
在github上git clone一個項目,在里面創(chuàng)建一個目錄粗卜,然后git push的時候屋确,出現(xiàn)報錯"Everything up-to-date"
原因:
(1)沒有g(shù)it add .
(2)沒有g(shù)it commit -m "提交信息"
如果上面兩個步驟都成功執(zhí)行,還出現(xiàn)這個錯誤是因為創(chuàng)建的目錄下是空的续扔,目錄下必須有文件才能git push上傳成功攻臀。
在github上創(chuàng)建文件的時候,在新文件名后加/符號就是文件夾纱昧,但是這種方式只支持英文名目錄刨啸,中文名目錄不支持。
解決提交到github報錯Please tell me who you are.和為不同的項目設(shè)置不同的名稱
Can't finish GitHub sharing process
Successfully created project 'Test' on GitHub, but initial commit failed:
*** Please tell me who you are.?Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity.?Omit --global to set the identity only in this repository.?fatal: empty ident name (for (null)>) not allowed during executing git -c core.quotepath=false commit -m "Initial commit" --
看了一下原來是git沒有配置的原因识脆,找到git目錄下的Git Bash運行设联,輸入下面兩行代碼即可
git?config?--global?user.email?"you@qq.com"??
git?config?--global?user.name?"Your?Name"
然后我根據(jù)網(wǎng)上搜索的方法進行嘗試,試了很多都不行灼捂,最終找到了一個可行的离例。
通過這個命令進行嘗試連接碼云,
$ ssh -T git@gitee.com
會報出如下錯誤:
Permission denied (publickey).
或者是:
Warning:Permanently added ‘git@’ to the list of known hosts permission denied (publickey)
或者:
Warning: Permanently added the ECDSA host key for IP address '218.11.0.86' to the list of known hosts.git@gitee.com: Permission denied (publickey).
二悉稠、解決方案
下面這篇文章就是指導(dǎo)我解決問題的文章宫蛆,這篇文章是設(shè)置GitHub的,但是碼云設(shè)置的方法一樣的猛。
https://www.cnblogs.com/qcwblog/p/5709720.html
1洒扎,生成公鑰辑甜,注意“”中的賬號必須是碼云的登錄賬號,我就是因為第一次輸入了lyj而失敗的
$ ssh-keygen -t rsa -C "694570206@1qq.com"
隨后出現(xiàn)如下命令袍冷,路徑可以不用修改,直接回車就行
Enter file in which to save the key (/root/.ssh/id_rsa):
接下來輸入兩次密碼猫牡,回車表示不設(shè)置密碼:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
表示成功
2胡诗,然后在終端中打開id_rsa.pub文件,把以ssh-rsa 開頭 以剛才輸入的賬號hncjliyingjie@163.com結(jié)尾的key 復(fù)制下來淌友。
3煌恢,在碼云上添加剛剛生成的公鑰 ,賬號-設(shè)置-安全設(shè)置-ssh公鑰