Question about GIT and how to use an existing project on the server?

Asked

Viewed 56 times

0

I’m currently getting into the git method, and I’ve really liked the way the development flows. But I ran into a problem. I have several projects that are already on their proper servers, sent via FTP traditional.

Creating the project from scratch and deploying it in an empty folder was easy, but when there are files in the folder I’m not able to post updates or copy the files to my project in Gitlab.

The question is how can I copy the files of one of these projects to a Gitlab project?

2 answers

2


If there are already files in the folder, create an empty repository from gitLab and then follow the steps below:

cd pasta_projeto
git remote add origin https://gitlab.com/seuUser/nomeDoProjeto.git
git add .
git commit -m "Initial commit"
git push -u origin master
  • If I understand correctly git remote add origin links the local folder to the project on gitLab, this part I believe I’ve already done and I don’t think I’ve been able to get past my real doubt. I’m having trouble deploying to a folder on my server, using deploy token, when I connect the error, the first saying that the folder is not empty, and another error that does not happen, even updating the entries in the project.

0

I don’t understand perfectly, but if you want to update the files after added.

use the command inside the main folder of the project

git pull origin master

Browser other questions tagged

You are not signed in. Login or sign up in order to post.