LoginSignup
10
9

More than 5 years have passed since last update.

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

Last updated at Posted at 2014-07-05

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)

参考

10
9
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
10
9