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

GitHubでforkしたprivateリポジトリの変更に追従しようとしてエラーになる系です

More than 5 years have passed since last update.

privateリポジトリをforkして作業している最中に、fork元の変更を取り込もうとして

git remote add upstream git://github.com/foo/bar.git
git fetch upstream

としたら

>fatal: remote error:
>  Repository not found.

となった。forkしなおすといけるけど格好わるい。

解決策

privateリポジトリの場合はgit:ではなくhttps:を使え、ということらしい。
なので、正しくはこうしよう。

git remote add upstream https://github.com/foo/bar.git
git fetch upstream
>Username for 'https://github.com':
>assword for 'https://username@github.com':

(おまけ)前の設定を消す

git remote add upstream https://github.com/foo/bar.git

> fatal: remote upstream already exists.

となったら

git remote rm upstream 

で、前の設定を消そう。

(おまけ)状況確認

自分のローカルとfork元との間の設定はどうなってんだっけ、の時:

git remote -v
>origin git@github.com:username/bar.git (fetch)
>origin git@github.com:username/bar.git (push)
>upstream   https://github.com/foo/bar.git (fetch)
>upstream   https://github.com/for/bar.git (push)

参考

http://www.skyverge.com/blog/github-repository-not-found-workaround/

chinmo@github
鳥取から開発現場を元気にする活動してます。 CoderDojo鳥取 チャンピオン CSP/CSM/CSPO TOGAF Enterprise Architect
jrits
信頼と魅力のある先進のITをもとに、お客様のワークスタイル・イノベーションの実現を目指します。
http://www.jrits.co.jp/
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
ユーザーは見つかりませんでした