Linux下Git和GitHub基本使用

Linux下Git和GitHub基本使用,第1张

1.创建Github账号,linux创建SSH密钥:ssh-keygen2.将公钥加入到Github账户信息Account

Settings,测试验证是否成功。ssh

-T

[email protected]

onovps!

You've

successfully

authenticated,

but

GitHub

does

not

provide

shell

access.3.GitHub创建项目。4.本地配置,新建Git项目并提交到Github。git

config

--global

user.name

'onovps'git

config

--global

user.email

'[email protected]'

#全局联系方式,可选touch

README.mdgit

init

#初始化git

add

README.md

#添加文件到本地仓库git

commit

-m

first

commit

#提交并备注git

remote

add

onovps

[email protected]:onovps/test.git

#增加一个远程服务器端版本库,名称为onovpsgit

push

-u

onovps

master

#将本地文件提交到Github。5.复制项目到本地:git

clone

git://github.com:onovps/test.git6.删除GitHub文件:git

rm

README.md

#本地倒库内删除git

commit

-m

rm

README.md

#提交到本地git

push

onovps

master

#提交到Github

[plain] view plaincopy01.ssh-keygen ##一直默认就可以了 3、将公钥加入到Github账户信息Account Settings->SSH Key 4、测试验证是否成功。

[plain] view plaincopy01.ssh -T [email protected] 02.Hi someone! You've successfully authenticated, but GitHub does not provide shell access.

同步github到本地1、复制项目到本地:


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/5941977.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-09
下一篇 2023-03-09

发表评论

登录后才能评论

评论列表(0条)

保存