I think it's pretty much all there in the title. I've got an existing project on a remote vps that I'd like to track with git, but I'm not sure the correct process. Do I need to create a bare repo on the server, then grab all the files, initialise them on local, then push them back up to the remote? Or is there another way to do it, i.e. somehow track the remote files, then clone to local?
1 Answer
Im not 100% sure what you wanna achieve but from my understanding... First go to the root of your existing project on your vps and do:
git init
In your github account, create a new repo and copy the ssh link to the newly created repo (if you have authenticated your device, else use the https link), it looks something like: "[email protected]:your_username/your_project_name.git"
Then on your existing vps project do:
git remote add origin [email protected]:your_username/your_project_name.git
git add -A
git commit -m 'init'
git push origin master
If you want to install and track the project from another device just do:
git clone [email protected]:your_username/your_project_name.git
And you will have a copy of the project. Hope this answers your question.
1 Comment
monkeyman
Yeah that's it. Thanks