GitHub又雙叒叕掛了?

引言
Github不能拉代碼了?
今天我像往常那樣更新一下Github代碼,發(fā)現(xiàn)竟然報了下面的錯誤:
$ git pull
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/<USERNAME>/<REPO>.git': The requested URL returned error: 403
意思是不再支持用戶名密碼的方式驗證了,需要創(chuàng)建個人訪問令牌(personal access token)。
解決
生成令牌
首先生成一個令牌,←鏈接是官網(wǎng)教程,也可以不點,直接看下文。
點擊Settings

點擊左側(cè)的Developer settings

點擊Personal access tokens(個人訪問令牌)

點擊Generate new token

設(shè)置token信息

點擊Generate token生成令牌得到生成的令牌

應(yīng)用令牌
將生成的令牌拷貝下來(不要拷貝我的,拷貝你自己生成的!),記得保存,下次你就看不到了。
修改現(xiàn)有項目的url
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
將<your_token>換成你自己得到的令牌。<USERNAME>是你自己github的用戶名,<REPO>是你的項目名稱,比如我的:
git remote set-url origin https://[email protected]/nlp-greyfoss/typora_notes.git/
其實上面的報錯中就有提示,不需要重新去找:
fatal: unable to access 'https://github.com/<USERNAME>/<REPO>.git':
https://github.com/<USERNAME>/<REPO>.git
然后再執(zhí)行git pull,世界又恢復(fù)原樣了。
船新版本對于全新版本,克隆的時候也在github.com前面加個令牌就好了。
git clone https://<TOKEN>@github.com/<user_name>/<repo_name>.git
最后一句:BUG,走你!


沒有人比我更懂Redis(一)
沒有人比我更懂Redis(二)
沒有人比我更懂Redis(三)
自然語言處理入門之分詞
入門人工智能必備的線性代數(shù)基礎(chǔ)
1.看到這里了就點個在看支持下吧,你的在看是我創(chuàng)作的動力。
2.關(guān)注公眾號,每天為您分享原創(chuàng)或精選文章!
3.特殊階段,帶好口罩,做好個人防護(hù)。
評論
圖片
表情
