Here is the situation:
I have inherited two separate machines, one used for “development” the other is the production machine. The problem: They are of course out of sync. In order to bring some sanity to situation I made independent git repositories of the application directory on each machine.
I now wish to be able to compare those repos so I can find out what is different between them. My idea was to make a third repository that contained two branches, one from the repository of the “dev” machine and one from the repository of the “prod” machine.
Is this or an equivalent solution possible with git ?
Thanks.
This would use what Git calls “remotes,” which are references to what a remote repository contains in order for you to be able to pull it into your own branch, push your branch into the remote repository, etc. You can set up a remote for each of the other machines, and then diff between them to compare them, and you can create one or more local branches from those remotes if you want to do local work.
What I’d suggest for your situation is cloning your development repository, which will create your third repository that you’ll be working in, and automatically create a remote named
originwhich points to your development repository (this is the conventional name for the default “upstream” place you will be pulling from an pushing to). Then, add a remote forprod, and now you can compare them and work with them locally. For example: