Slide 1

Slide 1 text

Advanced Git Mike McQuaid

Slide 2

Slide 2 text

/usr/local/bin/git-foo == git foo

Slide 3

Slide 3 text

git cherry master

Slide 4

Slide 4 text

git reflog

Slide 5

Slide 5 text

a369495 HEAD@{39}: commit (amend): Make tray icon strings more consistent. 5e7f0b0 HEAD@{40}: commit: Make tray icon strings more consistent. 8b84f7f HEAD@{41}: commit: Fix not being able to run previous task from menu. 436df83 HEAD@{42}: commit: Fix start task menu separator usage. 8e61a3f HEAD@{43}: rebase -i (continue): More consistent alternate row colors. 7c56620 HEAD@{44}: rebase -i (continue): Improve tasks eliding. 0def733 HEAD@{45}: checkout: moving from master to 0def733217f57276901da9ff578366f56d2d0f02 74fae75 HEAD@{46}: rebase -i (fixup): Improve tasks eliding. 515aa9b HEAD@{47}: rebase -i (fixup): updating HEAD

Slide 6

Slide 6 text

[alias] x = !gitx

Slide 7

Slide 7 text

[github] token = verysecurepassword123

Slide 8

Slide 8 text

[github] token = !security 2>&1 >/dev/null find- generic-password -gs github.token | grep password | cut -f2 -d\\\" #"

Slide 9

Slide 9 text

[alias] serve = !git daemon --reuseaddr --export- all --base-path=. --verbose ./.git

Slide 10

Slide 10 text

[core] excludesfile = ~/.gitignore

Slide 11

Slide 11 text

moc_*.cpp qrc_*.cpp ui_*.h *.pro.user *.o *.rej *.swp *~ .DS_Store CMakeLists.txt.user b/

Slide 12

Slide 12 text

[sendemail] identity = kdab thread = false chainreplyto = false suppresscc = all [sendemail "kdab"] smtpserver = mail.kdab.com smtpencryption = tls smtpserverport = 25 smtpuser = mike from = [email protected]

Slide 13

Slide 13 text

Merge vs Rebase

Slide 14

Slide 14 text

1 branch per feature git merge / git pull many branches with many merge commits 1 branch used for release

Slide 15

Slide 15 text

CMake

Slide 16

Slide 16 text

1 branch or commit per feature git rebase / git pull --rebase 1 branch with no merge commits 1 branch used for release

Slide 17

Slide 17 text

Homebrew

Slide 18

Slide 18 text

This is the short commit message Longer commit message that spans multiple lines. - List items - Like this

Slide 19

Slide 19 text

From 2ca294d83d8f64b8ff1611efa4aa4d1baa4f291a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 20 Apr 2011 12:17:37 +0100 Subject: [PATCH] Add DeployQt4 module. Add a module that gives better support to BundleUtilities to handle Qt plugins and deploy Qt applications. --- Modules/DeployQt4.cmake | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 Modules/DeployQt4.cmake diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake ...

Slide 20

Slide 20 text

git rebase 93b0c51

Slide 21

Slide 21 text

git merge 93b0c51

Slide 22

Slide 22 text

git clone ~/git1 ~/git2

Slide 23

Slide 23 text

git cherry-pick 93b0c51

Slide 24

Slide 24 text

Secure backup: 2ca294d83d8f64b8ff161 1efa4aa4d1baa4f291a

Slide 25

Slide 25 text

git filter-branch --tree-filter 'rm secretfile' HEAD

Slide 26

Slide 26 text

git diff 1b6d > my.patch git apply < my.patch

Slide 27

Slide 27 text

git format-patch 1b6d git am < 0001-ab.patch

Slide 28

Slide 28 text

git send-email 1b6d

Slide 29

Slide 29 text

git remote add other git://a/b.git git pull other a-branch

Slide 30

Slide 30 text

git diff origin/a other/b

Slide 31

Slide 31 text

git fetch git fetch other git fetch --all

Slide 32

Slide 32 text

export GIT_DIR=./a.git

Slide 33

Slide 33 text

GIT_WORK_TREE GIT_INDEX_FILE

Slide 34

Slide 34 text

git submodule add git://b/b.git b

Slide 35

Slide 35 text

git clone git://a/a.git cd a/b git submodule init git submodule update

Slide 36

Slide 36 text

superprojects

Slide 37

Slide 37 text

.gitattributes .git/info/attributes

Slide 38

Slide 38 text

*.pbxproj binary

Slide 39

Slide 39 text

*.doc diff=word

Slide 40

Slide 40 text

git config diff.word.textconv strings

Slide 41

Slide 41 text

*.png diff=exif

Slide 42

Slide 42 text

git config diff.exif.textconv exiftool

Slide 43

Slide 43 text

--- a/image.png +++ b/image.png @@ -1,12 +1,12 @@ -File Size : 70 kB -File Modification Date/Time : 2009:04:21 07:02:45-07:00 +File Size : 94 kB +File Modification Date/Time : 2009:04:21 07:02:43-07:00 -Image Width : 1058 -Image Height : 889 +Image Width : 1056 +Image Height : 827

Slide 44

Slide 44 text

*.txt ident echo '$Id$' > test.txt

Slide 45

Slide 45 text

applypatch-msg commit-msg post-commit post-receive post-update pre-applypatch pre-commit pre-rebase prepare-commit-msg update

Slide 46

Slide 46 text

http://zrusin.blogspot.com/2007/09/ git-cheat-sheet.html

Slide 47

Slide 47 text

Any questions?