75 lines
1.4 KiB
Markdown
75 lines
1.4 KiB
Markdown
# Anleitung: Template lokal forken (ohne Git-History)
|
|
|
|
Diese Anleitung beschreibt die Schritte aus diesem Chat, um ein Projekt-Template lokal zu klonen und mit einer frischen Git-History neu zu starten.
|
|
|
|
## Voraussetzungen
|
|
|
|
- Git ist installiert.
|
|
- Zugriff auf das Template-Repository ist moeglich (SSH oder HTTPS).
|
|
- Zielordner fuer das neue Projekt ist bekannt.
|
|
|
|
## Schritte
|
|
|
|
1. In den Zielordner wechseln:
|
|
|
|
```bash
|
|
cd /home/mathias/dev/web/foton
|
|
```
|
|
|
|
2. Template klonen (SSH bevorzugt):
|
|
|
|
```bash
|
|
git clone git@github.com:mathias2784/my_flask_temp.git foton_website
|
|
```
|
|
|
|
3. Falls SSH fehlschlaegt, mit HTTPS klonen:
|
|
|
|
```bash
|
|
git clone https://github.com/mathias2784/my_flask_temp.git foton_website
|
|
```
|
|
|
|
4. In das neue Projekt wechseln:
|
|
|
|
```bash
|
|
cd foton_website
|
|
```
|
|
|
|
5. Alte Git-History entfernen und frisches Repo initialisieren:
|
|
|
|
```bash
|
|
rm -rf .git
|
|
git init
|
|
```
|
|
|
|
## Optionale Naechste Schritte
|
|
|
|
- Standard-Branch auf main umbenennen:
|
|
|
|
```bash
|
|
git branch -m main
|
|
```
|
|
|
|
- Neues Remote-Repository hinzufuegen:
|
|
|
|
```bash
|
|
git remote add origin <NEUE_REPO_URL>
|
|
```
|
|
|
|
- Initialen Commit erstellen:
|
|
|
|
```bash
|
|
git add -A
|
|
git commit -m "Initial commit"
|
|
```
|
|
|
|
- Push zum neuen Remote:
|
|
|
|
```bash
|
|
git push -u origin main
|
|
```
|
|
|
|
## Hinweise
|
|
|
|
- Beim ersten SSH-Connect kann eine Host-Key-Abfrage erscheinen. Diese einmalig bestaetigen.
|
|
- Wenn SSH immer noch fehlschlaegt, HTTPS verwenden oder SSH-Key in GitHub einrichten.
|