Git,GitHub的基本使用
来源:互联网 发布:卖家如何找淘宝客推广 编辑:程序博客网 时间:2024/05/30 04:40
By BearsG
- 建立git与github之间的联系,使本地的文件能上传到github上
(1) 在自己的github上创建一个仓库(初始化)
在vim上新建一个文件夹并使之进入git状态: * mkdir firstFile * cd firstFile * git init
(2) 让git认识自己
* git config --global user.email "BearsG@BearsG.com该邮箱地址必须和github上邮箱一样) * git config --global user.name "BearsG" (名字和github上的用户名一样)
(3) 生成密匙
ssh-keygen -t rsa -C "BearsG@BearsG.com" 显示如下代码: Generating public/private rsa key pair. Enter file in which to save the key (user/home/.ssh/id_rsa): //此处是.ssh 的路径,可以更改或默认在当前路径 Enter passphrase (empty for no passphrase): //此处写生成密匙的密码 Enter same passphrase again: //在次输入密码
(4) 提交密匙
* users/.ssh/id_rsa.pub 打开id_rsa.pub(cat id_rsa.pub) ,并复制里面的密匙 * 打开github -> Eidting profile -> SSH KEY ,将复制的密匙加到KEY里面
(5) 检验是否链接上github
* 打开vim * ssh git@github.com 正常情况下显示 PTY allocation request failed on channel 0 Hi candy! You've successfully authenticated, but GitHub does not provide shell access Connection to github.com closed. (6) 推送文件到github * 进入已创建的firstFile文件, * git remote add origin git@github.com:BearsG/tmp.git * clone github上的库:git clone + 仓库地址(git clone https://github.com/BearsG/repository.git) * 把仓库加进本地git里:git add repository git commit -m "clone 了仓库" * 进入仓库:cd repository * touch first.c * git add first.c * git commit -m "set up first.c" * git push origin master 至此git,github的链接以成功并可以给github上传文件!
0 0
- Git,GitHub的基本使用
- git (github)的基本使用
- git/gitHub 基本使用
- git和github的基本使用
- Git和Github的基本使用
- git和github的基本使用
- Git基本操作和Github的使用
- Git的基本使用及基本流程(平台为GitHub)
- Git的基本了解与使用、向github提交代码
- git/github的使用
- github--git的使用
- Git/GitHub 的使用
- Git&GitHub的使用
- GitHub:Git的使用
- github的基本使用
- github的基本使用
- github的基本使用
- github的基本使用
- java爬虫
- iOS app 加急审核
- 如何在Eclipse中删除我们复制的代码中含有的行号
- Linux信号量机制(生产者消费者)
- java书籍阅读清单
- Git,GitHub的基本使用
- SSL证书中国市场份额,沃通WoSign跃居第二
- 内存管理(3)-Android内存泄露分析
- 0 java的运行环境及配置
- DM(达梦数据库导入dmp)
- 详解C++中指针(*)、取地址(&)、解引用(*)与引用(&)的区别 (完整代码)
- 17.3.2 Using Replication with Different Master and Slave Storage Engines
- IOS 自定义UINavigationBar返回按钮
- hadoop 自学指南十二之mahout