git push? Everything up-to-date
在github上git clone一個(gè)項(xiàng)目,在里面創(chuàng)建一個(gè)目錄,然后git push的時(shí)候,出現(xiàn)報(bào)錯(cuò)"Everything up-to-date"
原因:
(1)沒有g(shù)it add .
(2)沒有g(shù)it commit -m "提交信息"
如果上面兩個(gè)步驟都成功執(zhí)行,還出現(xiàn)這個(gè)錯(cuò)誤是因?yàn)閯?chuàng)建的目錄下是空的,目錄下必須有文件才能git push上傳成功。
在github上創(chuàng)建文件的時(shí)候,在新文件名后加/符號就是文件夾,但是這種方式只支持英文名目錄,中文名目錄不支持。
解決提交到github報(bào)錯(cuò)Please tell me who you are.和為不同的項(xiàng)目設(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運(yùn)行,輸入下面兩行代碼即可
git?config?--global?user.email?"you@qq.com"??
git?config?--global?user.name?"Your?Name"
然后我根據(jù)網(wǎng)上搜索的方法進(jìn)行嘗試,試了很多都不行,最終找到了一個(gè)可行的。
通過這個(gè)命令進(jìn)行嘗試連接碼云,
$ ssh -T git@gitee.com
會報(bào)出如下錯(cuò)誤:
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,生成公鑰,注意“”中的賬號必須是碼云的登錄賬號,我就是因?yàn)榈谝淮屋斎肓薼yj而失敗的
$ 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公鑰
