我知道這個話題到處都是,我真誠地嘗試了很多個小時,但沒有成功。
我的問題是我的 git 無法識別我自己的存盤庫。它在任何嘗試執行拉/推時為我提供了以下錯誤:
remote: Repository not found.
fatal: repository 'https://github.com/danieln-juno/bugreport.git/' not found
現在,我沒有拼錯存盤庫/URL 的名稱。另外,我確實有訪問權限,因為我是存盤庫的所有者。
當我執行命令時git remote -v,我得到了正確的 url:
origin https://github.com/danieln-juno/bugreport.git (fetch) origin
https://github.com/danieln-juno/bugreport.git (push)
我當前的本地檔案夾當然已經初始化了。
我只想補充一點,我已經初始化了 Git 并在 GitHub 上作業,直到我不得不進行系統重置(不是格式化),另外我想創建和使用一個新的 GitHub 帳戶。
我將 Windows10 與 MINGW64 (Git Bash) 一起使用。
任何想法可能導致此問題的原因是什么?
問候。
uj5u.com熱心網友回復:
你應該有 manager-core 作為憑證??助手。
檢查是否是這種情況:
git config --global credential.helper
檢查存盤在該助手中的內容:
printf "host=github.com\nprotocol=https" | git-credential-manager-core get
如果您確實看到了 GitHub 帳戶密碼,而不是GitHub PAT(個人訪問令牌),請將其洗掉并存盤令牌。
printf "host=github.com\nprotocol=https\nusername=danieln-juno" | git-credential-manager-core erase
printf "host=github.com\nprotocol=https\nusername=danieln-juno\npassword=yourToken" | git-credential-manager-core store
uj5u.com熱心網友回復:
沒有 VonC 的回答,我將無法解決問題。
當我按照他的步驟嘗試執行以下命令時:
printf "host=github.com\nprotocol=https" | git-credential-manager-core get
我注意到我以前的 GitHub 用戶得救了。
我已經洗掉了憑據,從“開始按鈕”->“憑據管理器”->“Windows 憑據”->“通用憑據”下,洗掉 git:https ://github.com憑據。
然后,我也在執行以下命令:
git config --unset credential.helper
之后,我執行了:
printf "host=github.com\nprotocol=https" | git-credential-manager-core get
并使用 GitHub 進行登錄認證。
最后的步驟,正如他所說:
printf "host=github.com\nprotocol=https\nusername=danieln-juno" | git-credential-manager-core erase
printf "host=github.com\nprotocol=https\nusername=danieln-juno\npassword=yourToken" | git-credential-manager-core store
VonC 值得所有的贊譽。我只是想補充一些可能對未來的程式員有所幫助的小點。希望它能幫助更多人。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/537642.html
標籤:混帐知乎
