How to change fetch URL of a git repository.

Taking references from the following question: github, update forked project

Do the following:

git remote add upstream <url of the repo you cloned from>

After this pull from upstream. This will pull all remote changes into your local copy.

If in future, you again need to pull changes from remote, you can pull from upstream again, this time without needing to add upstream url again.

Suggested Read-up: Syncing a fork


You can try:

git remote set-url origin /original/repo
git remote set-url --push origin /your/fork

That way, only fetch references the original repo URL.

The other more traditional approach, of course, is to declare another remote, as I detailed in "What is the difference between origin and upstream on GitHub?"

Tags:

Git

Pull

Git Fork