====== Git ====== Überblick: https://www.atlassian.com/git/tutorial Tagging: http://git-scm.com/book/en/Git-Basics-Tagging * ''%%git tag %%'' * ''%%git push origin %%'' * ''%%git tag%%'' (Alle Tags anzeigen) ''%%git clone %%'' ''%%git config user.name %%'' ''%%git config user.email %%'' ''%%git add %%'' ''%%git commit (-m “”)%%'' ''%%git status%%'' ''%%git pull %%'' z.B. ''%%git pull origin%%'' ''%%git push %%'' z.B. ''%%git push origin master%%'' ''%%git log --pretty=format:“%h - %an, %s”%%'' ''%%git stash save --keep-index%%'' Bei lokalen Änderungen, “die im Weg liegen” ''%%git stash apply%%'' Um die gestashten Änderungen wieder zurück zu mergen. ''%%git branch -a%%'' Zeige alle Branches. ''%%git branch %%'' Lege einen neuen Branch an. ''%%git checkout %%'' Wechsel in den Branch . ''%%git checkout -b %%'' Wechsel in den Branch und legt ihn an, falls er noch nicht existiert. ''%%git reset --hard && git pull%%'' Overwrite local changes. ''%%git init --bare %%'' Erzeugt (z.B. playground.git) welches anschließen ausgecheckt werden kann. ===== Git Submodules ===== Reading: * https://git-scm.com/book/en/v2/Git-Tools-Submodules Submodules are references to **COMMITS** in other gits. Submodules are useful for gits that depend on other components. usage: git submodule [--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] [] or: git submodule [--quiet] status [--cached] [--recursive] [--] [...] or: git submodule [--quiet] init [--] [...] or: git submodule [--quiet] deinit [-f|--force] (--all| [--] ...) or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference ] [--recursive] [--] [...] or: git submodule [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...] or: git submodule [--quiet] foreach [--recursive] or: git submodule [--quiet] sync [--recursive] [--] [...] or: git submodule [--quiet] absorbgitdirs [--] [...] ===== Git Hooks ===== Reading: * http://omerkatz.com/blog/2013/2/15/git-hooks-part-1-the-basics * http://omerkatz.com/blog/2013/5/23/git-hooks-part-2-implementing-git-hooks-using-python * https://codeinthehole.com/tips/tips-for-using-a-git-pre-commit-hook/ * http://ryanflorence.com/deploying-websites-with-a-tiny-git-hook/ ===== Repositories auf dev01 ===== /home/picalike-dev/pvt-dev/* Clone: # die Cash-Cow $ git clone ssh://picalike-dev@dev01.picalike.corpex-kunden.de/home/picalike-dev/pvt-dev/pvt-dev.git # zum Spielen $ git clone ssh://picalike-dev@dev01.picalike.corpex-kunden.de/home/picalike-dev/pvt-dev/playground.git # die perfekte Ergänzung zu caffe ;-) $ git clone ssh://picalike-dev@dev01.picalike.corpex-kunden.de/home/picalike-dev/pvt-dev/tee.git