Windows下如何用git连接远程仓库
- 在本地新建一个git仓库
- 关联远程仓库
- pull远程仓库的代码
在本地新建一个git仓库 【Windows下如何用git连接远程仓库】1.在某路径下git bash

文章图片
例如选择E盘,鼠标右键点击Git Bash Here
2.在打开的终端里设置global user.name 与 global user.email
$ git config --global user.name “your name”
$ git config --global user.email “your email”可通过如下指令查看设置是否成功
$ git config --global --list3.在该路径下新建一个文件夹(E盘下),并进入该文件夹下的路径进行下一步设置
![]()
文章图片
//初始化本地git仓库
$ git init

文章图片
$ git config --local user.name “your name”
$ git config --local user.email “your email”可通过如下指令查看设置
$ git config --local --list关联远程仓库
![]()
文章图片
$ git remote add origin 远程仓库地址可通过如下指令查看是否关联成功,如下图所示即关联成功
$ git remote -vpull远程仓库的代码
![]()
文章图片
$ git pull origin master