日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux命令行下载github文件,Linux命令行下使用GitHub

發布時間:2024/2/28 linux 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux命令行下载github文件,Linux命令行下使用GitHub 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Linux命令行下使用GitHub

1.注冊github賬號

2.創建ssh密鑰

cd ~

ssh-keygen -t rsa -C your_email@example.com

1

2

cd~

ssh-keygen-trsa-Cyour_email@example.com

會在~/.ssh/下生成id_rsa.pub文件,在github網站上的SSH and GPG keys —>New SSH Keys,標題隨便寫,可以寫計算機的名字,將id_rsa.pub里面的內容粘貼key里,最后點擊Add SSH Key。

3.打開終端

ssh -T git@github.com

1

ssh-Tgit@github.com

這一步如果提示Permission denied (publickey),就執行ssh-keygen -t rsa -b 4096 -C "your_email@example.com"重新產生key,出現一下提示,說明以正常連接到github

Hi ganchunsheng! You've successfully authenticated, but GitHub does not provide shell access.

1

Higanchunsheng!You'vesuccessfullyauthenticated,butGitHubdoesnotprovideshellaccess.

4.在github上創建倉庫

上傳代碼按照這個步驟:

git init #初始化

git add . #初始化本地倉庫

git commit -m "first commit" #加注釋,并提交到本地倉庫

git remote add origin https://github.com/xxxx/test.git #連接遠程倉庫

git push -u origin master #將本地倉庫的東西提交到master分支下

1

2

3

4

5

gitinit#初始化

gitadd.#初始化本地倉庫

gitcommit-m"first commit"#加注釋,并提交到本地倉庫

gitremoteaddoriginhttps://github.com/xxxx/test.git #連接遠程倉庫

gitpush-uoriginmaster#將本地倉庫的東西提交到master分支下

5.下載代碼

master分支:

git clone https://github.com/xxxx/test.git #xxxx為用戶名

1

gitclonehttps://github.com/xxxx/test.git #xxxx為用戶名

包含子分支:

git clone --recursive https://github.com/xxxx/test.git

1

gitclone--recursivehttps://github.com/xxxx/test.git

6.常見問題

(1)提示錯誤:fatal: remote origin already exists.解決辦法:

git remote rm origin

1

gitremotermorigin

(2)git未初始化

***Please tell me who you are.

Run

git config --global user.email "you@example.com"

git config --global user.name "Your Name"

1

2

3

4

***Pleasetellmewhoyouare.

Run

gitconfig--globaluser.email"you@example.com"

gitconfig--globaluser.name"Your Name"

解決辦法:

git config --global user.name "your_email"

config --global user.email your_email@example.com

1

2

gitconfig--globaluser.name"your_email"

config--globaluser.emailyour_email@example.com

總結

以上是生活随笔為你收集整理的linux命令行下载github文件,Linux命令行下使用GitHub的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。