Possibly related to http://stackoverflow.com/questions/286988/git-pulling-changes-from-clone-back-onto-the-master
I was working on an ASP.NET project when I discovered I needed to make an "experimental" set of changes which may or may not have been required in the production version.
The obvious thing to do was to create a branch.
However as I was familiar with darcs and svn but not git, I assumed that a clone was the "normal" way to create a branch (I now know that git branch
would have been more appropriate.)
I continued to work on the experimental change in the clone and, at the same time, other changes in the original repository.
Since then I have discovered that the experimental changes are desirable in the production version and would like to merge the two change sets.
If I had originally done a branch instead of a clone, this would be trivial. I'm sure it's not too hard to merge between separate repositories, but having looked through the docs I don't think it can be done with a single command (a simple pull
does not work.)
I haven't (yet) explicitly configured one repository as a "remote" of the other, but I am guessing this will be part of the solution.
The upstream repository at the time did not use any VCS - it was just a directory full of zips with version numbers appended to the file names.
So I would like to know:
- What's the easiest way to merge the change sets across repositories? (I don't expect any major conflicts.)
- Just how harmful is it to clone instead of branching? Have I lost any information by doing this, e.g. shared history, common dependencies?