Github远程仓库关联
2024-09-12 01:03:28
一、Git的安装
1、git的安装和配置
(1)配置用户名和邮箱,如下所示:
$ git config --global user.name [username]
$ git config --global user.email [email]
(2)使用git config --list查看已设配置的信息:
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=d:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
user.name=用户名
user.email=邮箱
core.autocrlf=false
core.repositoryformatversion=
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
2、SSH Key的配置:
1.Windows下打开Git Bash,创建SSH Key,按提示输入密码,可以不填密码一路回车
$ ssh-keygen -t rsa -C "注册邮箱"
然后用户主目录/.ssh/下有两个文件,id_rsa是私钥,id_rsa.pub是公钥。
2.获取key,打开.ssh下的id_rsa.pub文件,里面的内容就是key的内容
$ cat ~/.ssh/id_rsa.pub
3.登录GitHub,打开"SSH Keys"页面,快捷地址:https://github.com/settings/keys
4.测试ssh key是否成功,使用命令“ssh -T git@github.com”,如果出现You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。
二、在GitHub上创建远程仓库
1、点击上方导航栏的“+”按钮,在下方选择“New repository”。
2、进入到创建项目页面,按照下图所示输入你要创建项目的信息。
3、获取创建的仓库地址:
4、使用git clone [仓库地址],拉取代码到本地。
$ git clone git@github.com:xxxx/java_ee.git
5、接着可以进行git add、git commit、git push来进行操作。
最新文章
- 前端MVVM框架avalon揭秘 - 双向绑定原理
- 配置容器configuring Containsers
- sql语句常用说明与解析
- ubuntu 16.04 挂起后WiFi链接不上
- UVa 1646 (递推 JAVA大数) Edge Case
- Unity3D之Mecanim动画系统学习笔记(九):Blend Tree(混合树)
- string.Format字符串格式说明
- Oracle数据库之PL/SQL过程与函数
- <;php>;统计目录数和文件数
- Starling开发微信打灰机(二)
- html网页中 点击按钮页面跳转
- 119 - Greedy Gift Givers
- .net微软消息队列(msmq)简单案例
- 压缩空格的函数以及BCD码与ASCII相互转换函数
- 泛微oa几个常用的js
- Wireshark抓包实例诊断TCP连接问题
- 配置Django
- vue 给url 中文参数 添加编码解码
- Android ViewPage的使用(一)
- Python3基础 str format 位置参数与关键字参数