Help us understand the problem. What is going on with this article?

git fetchしてgit branch -rしてもリモートブランチが表示されなかった時

More than 3 years have passed since last update.

他の人のブランチをcheckoutしようとしたができない

remoteブランチがローカルの端末上だと表示されない。git fetch しても何をしてもどうしてもremoteブランチを取得できなかった。

行き着いた先のstackoverflow
http://stackoverflow.com/questions/12319968/remote-branch-not-showing-up-in-git-branch-r

つまり gitのconfigがおかしい。
.git/config
を覗いてみると以下の通り。

  1 [core]
  2     repositoryformatversion = 0
  3     filemode = true
  4     bare = false
  5     logallrefupdates = true
  6     ignorecase = true
  7     precomposeunicode = true
  8 [remote "origin"]
  9     url = https://github.com/github_account_name/hoge.git

ここに

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

を追加することで正しくリモートブランチをfetchすることができました。

chro96
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした