美文网首页
Git pull失败解决方案

Git pull失败解决方案

作者: EphemeralAurora | 来源:发表于2017-12-25 17:53 被阅读0次
Administrator@7PV3XG28ZW8YCKU MINGW64 /classes
$ git pull
fatal: Not a git repository (or any of the parent directories): .git

根据网上的提示

Administrator@7PV3XG28ZW8YCKU MINGW64 /classes
$ git init
Initialized empty Git repository in F:/Git/classes/.git/
Administrator@7PV3XG28ZW8YCKU MINGW64 /classes (master)
$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        Java0708Repo/

nothing added to commit but untracked files present (use "git add" to track)

又出现另外的错误

Administrator@7PV3XG28ZW8YCKU MINGW64 /classes (master)
$ git pull
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.

原因是远程仓库损坏,解决方案如下

Administrator@7PV3XG28ZW8YCKU MINGW64 /classes (master)
$ git remote add origin https://gitee.com/ShrekerNil/Java0708Repo.git

Administrator@7PV3XG28ZW8YCKU MINGW64 /classes (master)
$ git pull
remote: Counting objects: 3371, done.
remote: Compressing objects: 100% (2490/2490), done.
remote: Total 3371 (delta 1076), reused 825 (delta 117)
Receiving objects: 100% (3371/3371), 162.15 MiB | 3.66 MiB/s, done.
Resolving deltas: 100% (1076/1076), done.
From https://gitee.com/ShrekerNil/Java0708Repo
 * [new branch]      master     -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

相关文章

网友评论

      本文标题:Git pull失败解决方案

      本文链接:https://www.haomeiwen.com/subject/qbtrgxtx.html