Linux命令行下如何使用GitHub-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
Linux命令行下如何使用GitHub

本篇内容主要讲解“Linux命令行下如何使用GitHub”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Linux命令行下如何使用GitHub”吧!

昭阳ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!

1.注册github账号

2.创建ssh密钥

cd ~

ssh-keygen -t rsa -C your_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

这一步如果提示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.

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分支下

5.下载代码

master分支:

git clone https://github.com/xxxx/test.git #xxxx为用户名

包含子分支:

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

6.常见问题

(1)提示错误:fatal: remote origin already exists.解决办法:

git remote rm origin

(2)git未初始化

***Please tell me who you are.

Run

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

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

解决办法:

git config --global user.name "your_email"

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

到此,相信大家对“Linux命令行下如何使用GitHub”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


文章标题:Linux命令行下如何使用GitHub
本文路径:http://scgulin.cn/article/ijoddj.html