I’m new to Git. Let’s say Alice and Bob had been developing their project by using two Git repositories for each. And, Alice at certain times want to set up a new repository to manage their common progress. Do you think what is the best way to replace remote.origin.url in the configuration of Git?
- to replace by git config –replace
- to create new repos by git clone MAIN_REPOS
- or any?
If they already have a remote called
originbut want the new remote to be calledoriginthen the most logical thing to do is rename or remove the existing remote calledoriginand add a new one:If you don’t care about the old origin you can just reset the URL, but you would probably want to do a full
git fetchand agit remote prune originafterwards for tidiness.If you have a very recent git (>1.7.0), you have a remote sub command for this: