目錄
1--基本配置
2--本地上傳
1--基本配置
① 創(chuàng)建ssh-key
cd ~/.ssh
ssh-keygen -t rsa -C "郵箱地址"
② 查看并關(guān)聯(lián)ssh-key
gedit id_rsa.pub
? ? ? ? 復(fù)制內(nèi)容,在 GitHub 中依次點(diǎn)擊 Settings -> SSH and GPG keys -> New?SSH key,將 id_rsa.pub 文件中的字符串復(fù)制進(jìn)去;
③ 檢查關(guān)聯(lián)情況
ssh -T git@github.com
? ? ? ? 輸出歡迎信息即關(guān)聯(lián)認(rèn)證成功!
2--本地上傳
git init
git add .
git status
git commit -m "first commit"
git remote add origin https://github.com/liujf69/TensorRT-Demo.git
# 用于設(shè)置令牌
# 格式: git remote set-url origin https://<令牌名稱>@github.com/<用戶名><倉庫名>.git
git remote set-url origin https://ubuntu20.04@github.com/liujf69/TensorRT-Demo.git
git push -u origin master
# 輸入令牌對應(yīng)的密碼即可!
# 密碼在生成令牌時自動生成!
????設(shè)置令牌:
? ? ? ? Settings -> Developer Settings -> Personal access tokens -> Tokens (classic) -> Generate new token;
? ? ? ? 默認(rèn)勾選所有權(quán)限即可,同時設(shè)置令牌的有效時間;
? ? ? ? 生成的密碼注意保存,其刷新即消失;文章來源:http://www.zghlxwxcb.cn/news/detail-629670.html
????????推送新文件夾時,可以先將遠(yuǎn)端倉庫 clone 下來(為了將本地倉庫和遠(yuǎn)程倉庫進(jìn)行同步),再加入新的文件夾,重新進(jìn)行 push 上傳文章來源地址http://www.zghlxwxcb.cn/news/detail-629670.html
到了這里,關(guān)于Git筆記--Ubuntu上傳本地項(xiàng)目到github的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!