配置vscode与github
配置vscode与github
当配置邮箱、账户名与SSH私钥和公钥完成之后,建立本地文件与GitHub仓库链接操作步骤:
- 在本地为自己的工程创建文件夹,在该文件夹(空文件夹)上右击,选择 Git Bash Here
- 输入命令 :git init
- 输入命令:git remote add origin [email protected]:dashuaige/pytorch_backup.git
origin 用来代替 [email protected]:dashuaige/pytorch_backup.git 的名字,origin可以用任意名字代替,后面保持一致即可。后面的地址是你仓库的 SSH 地址(不能错), SSH 地址如下图所示:打开新建的远程仓库,单击绿色的”Clone or download“按钮,在弹出的对话框中,单击右上角的”Use SSH“切换到SSH模式,默认是”Use HTTPS“模式。
-
查看已经建立关联的远程仓库名称:git remote
-
查看已经建立关联的远程仓库详细信息:git remote -v
-
测试远程仓库的链接情况:ssh -T [email protected]
-
git pull origin master --allow-unrelated-histories
origin:为刚才起的名字
完成以上步骤便可以在vscode中使用下图所示的功能,方便管理GitHub。
- 从GitHub拉取代码:git clone [email protected]:dashuaige/pytorch_backup.git
[email protected]:dashuaige/pytorch_backup.git是你想要下载库的链接。