This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| git [2014/01/23 15:11] – created admin | git [2021/01/19 22:58] (current) – [Git Changelog] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Git Commandline ====== | ====== Git Commandline ====== | ||
| + | |||
| + | |||
| + | :!: Befehle kommen von hier: http:// | ||
| ===== Befehle (lokal, kein Internet benötigt ) ===== | ===== Befehle (lokal, kein Internet benötigt ) ===== | ||
| Line 15: | Line 18: | ||
| git commit -m ' | git commit -m ' | ||
| + | |||
| + | ==== Zeige Branches ==== | ||
| + | |||
| + | git branch | ||
| + | |||
| + | ==== GIT Einstellungen ==== | ||
| + | |||
| + | Benutzer und E-Mail setzen. | ||
| + | |||
| + | git config --global user.name "John Doe" | ||
| + | git config --global user.email johndoe@example.com | ||
| + | |||
| + | |||
| + | ===== Befehle die Internet benötigen ===== | ||
| + | |||
| + | ==== Master-Branch hoch schieben ==== | ||
| + | |||
| + | Schiebt die lokale Repoauf die online Repository (origin) in den Branch (master) | ||
| + | |||
| + | git push origin master | ||
| + | | ||
| + | ==== Repository downloaden (Clone) ==== | ||
| + | |||
| + | git clone http:// | ||
| + | |||
| + | |||
| + | ====== Git Submodules (sub repository) ====== | ||
| + | |||
| + | ===== Create a Submodule ===== | ||
| + | |||
| + | To link one repository into another in git you can use a thing called submodules: | ||
| + | |||
| + | git submodule add http:// | ||
| + | |||
| + | Example: | ||
| + | |||
| + | cd / | ||
| + | git submodule add https:// | ||
| + | git add . | ||
| + | git commit -m "Add submodules ..." | ||
| + | git push origin master | ||
| + | |||
| + | ===== Clone a Repo containing submodules/ ===== | ||
| + | |||
| + | Submodules need to be initialized and downloaded | ||
| + | |||
| + | cd / | ||
| + | git submodule init | ||
| + | git submodule update | ||
| + | |||
| + | |||
| + | ===== Update a submodules repo ===== | ||
| + | |||
| + | When updating a submodule its required to tell the parent repository to use the latest downloaded version. | ||
| + | |||
| + | cd / | ||
| + | git pull origin master | ||
| + | cd / | ||
| + | git commit -am " | ||
| + | git push origin | ||
| + | |||
| + | ===== Pull ===== | ||
| + | |||
| + | git pull origin | ||
| + | git submodule update | ||
| + | |||
| + | ====== Change git Author ====== | ||
| + | |||
| + | <code bash git.sh> | ||
| + | #!/bin/sh | ||
| + | |||
| + | git filter-branch -f --env-filter ' | ||
| + | |||
| + | OLD_EMAIL=" | ||
| + | CORRECT_NAME=" | ||
| + | CORRECT_EMAIL=" | ||
| + | |||
| + | if [ " | ||
| + | then | ||
| + | export GIT_COMMITTER_NAME=" | ||
| + | export GIT_COMMITTER_EMAIL=" | ||
| + | fi | ||
| + | if [ " | ||
| + | then | ||
| + | export GIT_AUTHOR_NAME=" | ||
| + | export GIT_AUTHOR_EMAIL=" | ||
| + | fi | ||
| + | ' --tag-name-filter cat -- --branches --tags | ||
| + | </ | ||
| + | |||
| + | ====== Git Changelog ====== | ||
| + | |||
| + | Generate a simple changelog of all commits between latest 2 tags. | ||
| + | |||
| + | <code bash> | ||
| + | # | ||
| + | |||
| + | TAGS=($(git tag --sort=-version: | ||
| + | git log --pretty=format:" | ||
| + | </ | ||