I have inherited a Ruby on Rails project that is currently deployed on a live website. While I have admin control of this project's git repository on Bitbucket, the live instance of the project (that is, the directory structure and all the source files) running on my server appears to have been downloaded rather than cloned.
How do I turn this instance into a proper git checkout referencing the Bitbucket origin and the master branch?
My initial thought was:
cd projectdir/
git init
git remote add origin git@bitbucket.org:my_group/my_project.git
git checkout master
I tested that on another downloaded instance of the project, but this git error is making me think twice:
error: The following untracked working tree files would be overwritten by checkout:
# a listing of all the files in the project...
There is no difference between the source files in the live instance of this project and what's on the master branch in the repository. However, I do want to minimize my risk of overwriting something important and messing up this instance. I'm using Phusion Passenger with Apache on Mac OSX, and I don't mind bringing Apache down to make the changes. Thanks for your help.