Change Git Repository Of Existing Xcode Project
As mentioned in "Git XCode - change origin
", you simply can change the remote origin
url, using git remote set-url
(or in your case, rename+add).
git remote rename origin upstream
git remote add origin /url/of/private/repo
(with the XCode GUI, you could remove, then add again, the remote origin
)
If that private repo is empty, you can push to the full history of your cloned repo.
By renaming 'origin
' to 'upstream
', you keep the possibility to fetch from the original repo, while pushing to your new origin
target repo.
You can do it through UI
Select Source Control Navigator from the left pane
There you can find your current remote repo under the Remotes Folder,
then delete the existing repo:
Now You can add Your Existing Remote
Enter Remote URL