0

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 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah that's it. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.