Setup neues Git Repo in existierendem Shop

1. Optional: Live Umgebung kopieren

vim oder nano benutzen um copy-shop.sh script zu bearbeiten:

vi ./copy-shop.sh

ggf. Ausführrechte geben:

chmod +x ./copy-shop.sh

2. Git Repo initialisieren

.gitignore in Verzeichnis platzieren.

git init

git add .

git commit -m "Initial commit"

3. Optional: Aktuellen Stand in Backup-Branch speichern

git branch backup-live

git branch -M main

4. Mit Gitlab verbinden & backup branch an Gitlab schicken

git remote add origin <gitlab-url>

git push origin main

git push -f origin main (-f benutzen falls initial commit auf gitlab existiert wegen README.md. -f muss freigeschaltet werden: settings->reopsitory->protected branches->allow force push)

Tipps

Git Credentials in Cache speichern:

git config --global credential.helper 'cache --timeout=600'