How can I import a Git repo from a local server to DevOps? I am not talking about a depo already hosted on GitHub, but a bare repo that is just living on a local server.
CodePudding user response:
Thanks all. All your feedback helped me to solve my problem.
I was focused on import, only import. And it seems like it's not possible to directly import from a local repo.
The solution was to create an empty repo in DevOps, add it as remote to my local repo (git remote add), and push to this remote (git push -u). As simple as this, and probably obvious for most people but it wasn't for me!
CodePudding user response:
There is only two way:
One:
You need to host the repo to a remote server (github etc.) which is accessible by both local machine and DevOps machine.
Two:
You most likely need to clone the local git project to DevOps machine. In this way you can use scp
tools to copy the repo to other machine. For example. i have repo in user's home directory /home/local_machine/git_project
.
copy git repo using remote machine:
scp -r <username>@<local_machine_ip>:/home/local_machine/git_project /home/devops_machine/
In this way you will be able to clone or copy local git repository without using 3rd party hosting sites.