解决git pull,报fatal: No remote repository specified. Please......

简介: 在将本地项目传到GitHub上去的时候~/Aliyun/alioss-file on  master ⌚ 16:27:53$ git pullfatal: No remote repository specified.

在将本地项目传到GitHub上去的时候

~/Aliyun/alioss-file onmaster16:27:53
$ git pull
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.

这个时候,需要编辑项目下的.git文件夹中

~/Aliyun/alioss-file onmaster16:41:37
$ cd .git

~/Aliyun/alioss-file/.git onmaster16:55:24
$ ls
COMMIT_EDITMSG ORIG_HEAD      description    info           refs
FETCH_HEAD     branches       hooks          logs
HEAD           config         index          objects

~/Aliyun/alioss-file/.git onmaster16:55:54
$ 

编辑vi config

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

        ignorecase = true

        precomposeunicode = false

[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = https://github.com/xiongben-tongxue/alioss-file.git
        pushurl= https://github.com/xiongben-tongxue/alioss-file.git
[branch "master"]
        remote = origin
        merge = refs/heads/master

将下面这两项换成你自己的

url = https://github.com/xiongben-tongxue/alioss-file.git
pushurl= https://github.com/xiongben-tongxue/alioss-file.git

保存后就搞定了。

目录
相关文章
|
2月前
|
开发工具 git 开发者
|
2月前
|
开发工具 git 开发者
Git Pull vs. Git Fetch:深度解析
【2月更文挑战第29天】
199 0
Git Pull vs. Git Fetch:深度解析
|
3月前
|
网络安全 开发工具 git
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
21 0
|
10天前
|
网络安全 数据安全/隐私保护
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
|
3月前
|
开发工具 git
Git:error: remote origin already exists
Git:error: remote origin already exists
23 2
|
4月前
|
存储 网络安全 数据处理
git远程操作,推送【push】,拉取【pull】,忽略特殊文件,配置别名,标签管理
git远程操作,推送【push】,拉取【pull】,忽略特殊文件,配置别名,标签管理
|
5月前
|
开发工具 git
解决:fatal: not a git repository (or any of the parent directories): .git的问题
解决:fatal: not a git repository (or any of the parent directories): .git的问题
|
28天前
|
缓存 数据可视化 网络安全
Git命令大全
Git命令大全
58 1
|
1月前
|
开发工具 git
Git教程:深入了解删除分支的命令
【4月更文挑战第3天】
51 0
Git教程:深入了解删除分支的命令

相关实验场景

更多