Moving the git remote to the updated URL and thus getting access changes made to the updated git repo is already explained in the “transferring a repository” link Amanda already provided.
Specifically the most relevant portion for users cloning a repo is:
All links to the previous repository location are automatically redirected to the new location. When you use git clone
, git fetch
, or git push
on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid confusion, we strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote
on the command line:
git remote set-url origin NEW_URL
Warning: If you create a new repository or fork at the previous repository location, the redirects to the transferred repository will be deactivated. They can be reactivated by renaming or deleting the new repository or fork.
If you need a specific example:
This is an example of cloning the old repo (this mocks you already having the previous repo on your local machine), then changing the remote URL to the updated EpicGamesEx repo.
This is what you should already have on your local machine:
clemens@clemens-desktop:~/Documents/projects/Test$ git clone git@github.com:EpicGames/PixelStreamingInfrastructure.git
Cloning into 'PixelStreamingInfrastructure'...
remote: Enumerating objects: 6568, done.
remote: Counting objects: 100% (2232/2232), done.
remote: Compressing objects: 100% (628/628), done.
remote: Total 6568 (delta 1668), reused 2076 (delta 1553), pack-reused 4336
Receiving objects: 100% (6568/6568), 24.07 MiB | 14.76 MiB/s, done.
Resolving deltas: 100% (4473/4473), done.
Update remote URL:
clemens@clemens-desktop:~/Documents/projects/Test$ cd PixelStreamingInfrastructure/
clemens@clemens-desktop:~/Documents/projects/Test/PixelStreamingInfrastructure$ git remote get-url origin
git@github.com:EpicGames/PixelStreamingInfrastructure.git
clemens@clemens-desktop:~/Documents/projects/Test/PixelStreamingInfrastructure$ git remote set-url origin git@github.com:EpicGamesExt/PixelStreamingInfrastructure.git