LoginSignup
8
7

More than 3 years have passed since last update.

git pull origin masterしたら「fatal: Couldn't find remote ref master」となる

Last updated at Posted at 2020-02-19

事象

GitHubにリポジトリは作成されているのに、git pull origin masterしたら以下のようになる。

$ git pull origin master
fatal: Couldn't find remote ref master

原因

まだGitHubのリポジトリ上に一つもファイルを作成していないため、masterブランチが作成されていなかった。
image.png

解決

一度pushした後なら、正常にpullできるようになった。

$ git push origin master
Counting objects: 8, done.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 3.02 KiB | 1.51 MiB/s, done.
Total 8 (delta 0), reused 0 (delta 0)
To https://github.com/r-wakatsuki/hoge.git
 * [new branch]      master -> master
$ git pull origin master
From https://github.com/r-wakatsuki/hoge
 * branch            master     -> FETCH_HEAD
Already up-to-date.

以上

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7