tags:

views:

202

answers:

2

A git clone is set up to support pushing/pulling back into the original repository. How do I use git-remote (and/or other commands, configuration files, etc.) to change the two repositories such that the original will now act like the clone, pushing and pulling into it by default, and the clone will now act as the original, with no knowledge of the clone?

+7  A: 

Issue these commands on what used to be the remote:

% git remote add origin user@machine:/path/to/repo
% git config branch.master.remote origin
% git config branch.master.merge  refs/heads/master
% git pull

Then on the old clone:

% git remote rm origin
Paul Beckingham
A: 

You just have to edit the .git/config file in both repository and change the "url" of remote "origin"

You can therefor use the git-config command (see the man for options) in order to change global option for a git repository.

claferri