linux:git
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| linux:git [2015/12/07 21:01] – move | linux:git [2020/08/14 21:56] (aktuell) – move | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== git ====== | ====== git ====== | ||
| - | {{wp> | ||
| - | ===== Cloning an existing Repository | + | ===== Beispiele ===== |
| + | ==== 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 ==== |
| + | < | ||
| + | git pull origin | ||
| + | </ | ||
| - | > git pull origin | + | ==== Datei aus Repo entfernen ==== |
| - | ===== Datei aus Repo entfernen ===== | + | <Code> |
| - | + | git rm Datei | |
| - | > 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 ==== | ||
| + | Repo hinzufügen: | ||
| + | |||
| + | < | ||
| + | git remote add origin https:// | ||
| + | </ | ||
| + | |||
| + | Repo entfernen: | ||
| + | |||
| + | < | ||
| + | git remote rm origin | ||
| + | </ | ||
| + | |||
| + | ===== Konfiguration ===== | ||
| + | ==== Passwort zwischenspeichern ==== | ||
| + | |||
| + | < | ||
| + | git config --global credential.helper "cache --timeout=3600" | ||
| + | </ | ||
| + | |||
| + | ===== Siehe auch ===== | ||
| + | * [[gogs]] | ||
| + | * [[gitea]] | ||
| + | * [[mediawiki: | ||
| + | * [[RabbitVCS]] | ||
| ===== Weblinks ===== | ===== Weblinks ===== | ||
| * [[https:// | * [[https:// | ||
linux/git.1449522113.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
