Git 拉取远程项目报错 $ git pull fatal: No remote repository specified. Please, specify e

176 阅读1分钟

$ git pull fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should

解决方案: 本地拉取项目缺少远程仓库配置

  1. git niit git初始化在本地项目文件夹中生成 .git 文件
  2. .git文件夹修改config文件

[core] repositoryformatversion = 0

filemode = false

bare = false

logallrefupdates = true

symlinks = false

ignorecase = true

precomposeunicode = false

[remote "origin"]

url = gitee.com/xxxxx/react…

fetch = +refs/heads/:refs/remotes/origin/

pushurl = gitee.com/xxxx/react.…

[branch "master"]

remote = origin

merge = refs/heads/master

[branch "React-todos"]

remote = origin

merge = refs/heads/React-todos

两个有URL的地方修改成远程仓库地址

  1. git pull 拉取远程项目
  2. git checkout 远程分支名 ----切换分支

本地切换分支,所有分支项目都会在一个文件夹中展示,不同分支文件夹中展示不同内容