首次使用git 的配置步驟

一:首先下載Git  客戶端;

二:設置用戶名和郵箱:           git config --global user.name "xxx"     git config --global user.email "xxxx" , git pull 發現沒有認證。

三:生成公鑰和私鑰:在git bash 中輸入: ssh-keygen, 一直回車, 生成文件在C:\Users\Administrator 的 .ssh文件夾下

四:登錄 git ,發現需要身份驗證碼。此時由於我的手機更換了,所以沒有辦法得到驗證碼, 此時的解決辦法是找到上一個公鑰生產的10個序列號的任意一個,黏貼,登陸。

五:安裝身份驗證器:手機生成的且我的本地也沒有安裝身份驗證器, 方法是到百度搜索“google 身份驗證器”, 安裝。

六:安裝後需要登陸, 進入git 後,點擊自己頭像,進入settings, 選擇ssh - keys, 找到自己的name 和password, 輸入到app上登陸, 當然web 上也有二維碼,但是掃碼需要安裝更新googleplay 啥的,麻煩。登陸後就會有隨時更新的驗證碼了。

七: 將步驟三生成的公鑰.rsa內容複製黏貼到對應的方框中,生成新的10個驗證序列,用於下次更換手機時。

提示次爲:Should you ever lose your phone or access to your one time password secret, each of these recovery codes can be used one time each to regain access to your account. Please save them in a safe place, or you will lose access to your account.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章