why can I not add an upstream git repo?

2.1k Views Asked by At

I took a fork of master and master has received a few updates in the meantime that I now want to pull into my fork. So what I did was: cloned the fork to local disk, went into the dir and used git remote add upstram http://xx.xxx.xxx.xxx:pppp/path/to.git to add the master as upstream repo. Then a git fetch upstream gives me:

fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

and I do have a clone of that master repo on my disk too so I sure have read access. What's the problem here?

Thank you!

3

There are 3 best solutions below

0
On BEST ANSWER

Sorry for replying this way, but I cannot comment.

Did you notice your command is: git remote add upstram http://xxx.xxx.xxx.xxx:pppp/path/to.git

"upstram" not "upstream"?

I believe this could be the problem...

If you're not familiar with the command already - run "git remote -v" to see the remotes.

0
On

As I think you want to connect your local git repo with remote repo, here is my advice, considering using:git remote set-url origin [your remote git repo url] this is for changing your git remote repo link refs.

For a new local git repo you should use:git remote add origin [your remote git repo url]

I hope that would helps you.

0
On

In your command to add the remote you named upstram, not upstream. Check the name of your remotes: git remote show