Initial Commit from Live Server

Hi everyone! :slight_smile:

I’m quite new on the Git / CI topic. So hopefully my question isn’t too silly :wink:

I’m on building my deployment workflow for our Webshop (Apache2 / Ubuntu) . The workflow is like this: local → Gitlab → Stage → Live. The live Version is already online since some month. So to start I have to do the initial commit from our Live System to GItlab. What’s the best way to this? When I do on my live server:

cd existing_folder
git init
git remote add origin git@gitlab.comxxx.git
git add .
git commit
git push -u origin master

It creates all the git files that I actually don’t want or need. So my plan was to download the files from the live Server and then do the initial commit in from my local machine. And afterwards deploy to my stage shop.

Any suggestions?

Thanks

Well, git files live in .git/, and I think it’s no big deal to leave them there. Just put in some exclusions in the site’s conf and you can ‘forget’ about that dir…

In the future, I recommend you to push from Staging, and let Live pull from the repo.