I'm not sure how to ask this the best way, but we have a test server set up at work and we have a production server. We develop mostly on the test server then when done with a feature push the code (manually) to the production server.
Now I've thought to get away from this we could use Git so I wrapped all the files and whatnots and created a Git repo. Great, the test server is set up.
Now what? Set up another Git repository from the files (that are different) that are on the production server? Then? From there merge the two repos into a single repo?
Note: some developers will edit files on the production server and won't move those files back to our test server (mainly because the feature they are working on isn't done yet) so now there is new changes that haven't been updated on our test server and new changes that need to now be moved to production.
I would approach it like described below (will unfortunately be quite a lot of manual work to sync the two). The reason for the reset and creation of seperate branches is to be able to merge a single new feature into production after the sync.
git remote add prod <url>
git fetch prod
git reset --soft prod/master
Note that it is important that no new branches are based on test/master but prod/master. Otherwise it will not be possible to merge it to production without taking other commits with it (which also is why we did a git reset and created seperate branches).
If files are created or edited on directly on the master server they need to be commited there and merge back into test.
If you don't manage to get all the developers to use git you might end up spending more time than you'd like managing branches etc, so I would recommend looking over the workflow to make life after syncing the repos easier. Git is unfortunately not a good solution if you're using a workflow that doesn't fit.