linux:git
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| linux:git [2017/01/21 11:48] – move | linux:git [2020/08/14 21:56] (aktuell) – move | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== git ====== | ====== git ====== | ||
| - | {{wp> | ||
| ===== Beispiele ===== | ===== Beispiele ===== | ||
| ==== Cloning an existing Repository ==== | ==== Cloning an existing Repository ==== | ||
| - | > git clone https:// | + | <Code> |
| + | git clone https:// | ||
| + | </ | ||
| ==== Committing Changes to your Repository ==== | ==== Committing Changes to your Repository ==== | ||
| - | > git add mynewfile.txt | + | <Code> |
| + | git add mynewfile.txt | ||
| + | </ | ||
| If you have simply updated (or deleted) existing files we simply pass the -u argument to the add argument: | If you have simply updated (or deleted) existing files we simply pass the -u argument to the add argument: | ||
| - | > git add -u | + | <Code> |
| + | git add -u | ||
| - | > git commit -m “Updated the README file” | + | git commit -m “Updated the README file” |
| - | > git push origin | + | git push origin |
| + | </ | ||
| ==== Updating a local Git Repository ==== | ==== Updating a local Git Repository ==== | ||
| - | + | <Code> | |
| - | > git pull origin | + | git pull origin |
| + | </ | ||
| ==== Datei aus Repo entfernen ==== | ==== Datei aus Repo entfernen ==== | ||
| - | > git rm Datei | + | <Code> |
| + | git rm Datei | ||
| + | </ | ||
| Ordner nur rekursiv: | Ordner nur rekursiv: | ||
| - | > git rm -r Ordner | + | <Code> |
| + | git rm -r Ordner | ||
| + | </ | ||
| + | |||
| + | ==== Sensible Daten aus Versionshistorie entfernen ==== | ||
| + | === BFG Repo-Cleaner === | ||
| + | * https:// | ||
| + | |||
| + | Beispiel: | ||
| + | * Nach https:// | ||
| + | < | ||
| + | # Zuerst eine frische Kopie klonen mit dem --mirror-Flag | ||
| + | git clone --mirror git:// | ||
| + | |||
| + | Mit --mirror wird die volle Datenbank geklont, aber nicht die eigentlichen Dateien. | ||
| + | |||
| + | cd some-bad-repo.git | ||
| + | |||
| + | java -jar ../bfg --delete-files YOUR-FILE-WITH-SENSITIVE-DATA | ||
| + | |||
| + | git reflog expire --expire=now --all && git gc --prune=now --aggressive | ||
| + | |||
| + | git push | ||
| + | </ | ||
| + | |||
| + | ==== Branches ==== | ||
| + | Branch hinzufügen: | ||
| + | < | ||
| + | git branch testing | ||
| + | </ | ||
| + | |||
| + | In den Branch wechseln: | ||
| + | < | ||
| + | git checkout testing | ||
| + | </ | ||
| ==== Entfernte Repos ==== | ==== Entfernte Repos ==== | ||
| - | Repo hinzufügen | + | Repo hinzufügen: |
| - | > git remote add origin https:// | + | |
| - | Repo entfernen | + | < |
| - | >git remote rm origin | + | git remote add origin https:// |
| + | </ | ||
| + | |||
| + | Repo entfernen: | ||
| + | |||
| + | <Code> | ||
| + | git remote rm origin | ||
| + | </ | ||
| ===== Konfiguration ===== | ===== Konfiguration ===== | ||
| - | Passwort zwischenspeichern | + | ==== Passwort zwischenspeichern ==== |
| - | > git config --global credential.helper "cache --timeout=3600" | + | |
| + | <Code> | ||
| + | git config --global credential.helper "cache --timeout=3600" | ||
| + | </ | ||
| ===== Siehe auch ===== | ===== Siehe auch ===== | ||
| * [[gogs]] | * [[gogs]] | ||
| + | * [[gitea]] | ||
| * [[mediawiki: | * [[mediawiki: | ||
| + | * [[RabbitVCS]] | ||
| ===== Weblinks ===== | ===== Weblinks ===== | ||
| * [[https:// | * [[https:// | ||
linux/git.1484999287.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
