vscode上git连接远程仓库-码云的使用
date
Feb 12, 2018
slug
2018-02-12
status
Published
tags
工具
summary
type
Post
捣鼓老半天,总算是弄上了.
我主要漏了一个步骤,设置SSH公钥,这是用来上传使用的身份证
- git初始化
git init
- 设置user.name user.email
git config --global user.name yourName //**注意,--和global之间没有空格**
git config --global user.email yourName@gmail.com
- 生成SSH公钥生成/添加SSH公钥来自码云
- 连接远程代码仓库在远程仓库上创建一个Repository,复制地址接下来到当前Repository文件夹根目录中,如果没有初始化过,请先初始化
git remote add origin https://github.com/xuanhun/vscode.git
git pull origin master
现在我们查看一下.git文件夹下的config文件,可以看到添加了远程Reps地址。
![notion image](https://www.notion.so/image/https%3A%2F%2Fcdn.nlark.com%2Fyuque%2F0%2F2021%2Fpng%2F713943%2F1611810716876-eb8d8eab-f974-4298-80ac-8e896fcc60a9.png?table=block&id=35a1497f-ebd2-4269-ab15-a434d3847172&cache=v2)
接下来我们从下拉菜单中执行发布命令。
![notion image](https://www.notion.so/image/https%3A%2F%2Fcdn.nlark.com%2Fyuque%2F0%2F2021%2Fpng%2F713943%2F1611810716886-2113534f-44f4-4775-aa42-bd0e37f178c5.png?table=block&id=f3dbd6fc-af3a-476e-9600-cad77b5e520e&cache=v2)
这时会提醒我们输入账号和密码。
输入之后,会把本地提交的文件同步到远程仓库,我这里使用
码云
。同步之后再打开git的隐藏菜单,可以看到 同步等命令可以直接使用了。