Slide 1

Slide 1 text

Working with others using and @MikeMcQuaid

Slide 2

Slide 2 text

Mike McQuaid Senior Engineer at GitHub https://github.com/MikeMcQuaid

Slide 3

Slide 3 text

@MikeMcQuaid mike@mikemcquaid.com https://mikemcquaid.com

Slide 4

Slide 4 text

why version control?

Slide 5

Slide 5 text

https://github.com/GitInPractice/GitInPractice/blob/master/ D-WhyUseVersionControl.adoc#handling-changes

Slide 6

Slide 6 text

https://github.com/GitInPractice/GitInPractice/blob/master/ D-WhyUseVersionControl.adoc#handling-changes

Slide 7

Slide 7 text

https://github.com/GitInPractice/GitInPractice/blob/master/ D-WhyUseVersionControl.adoc#version-control-workflow

Slide 8

Slide 8 text

https://github.com/GitInPractice/GitInPractice/blob/master/D- WhyUseVersionControl.adoc#version-control-for-programmer-collaboration

Slide 9

Slide 9 text

GitHub

Slide 10

Slide 10 text

https://github.com/join

Slide 11

Slide 11 text

https://education.github.com/pack

Slide 12

Slide 12 text

https://github.com/new

Slide 13

Slide 13 text

clone

Slide 14

Slide 14 text

https://github.com/MikeMcQuaid/strap

Slide 15

Slide 15 text

$ git clone https://github.com/MikeMcQuaid/strap Cloning into 'strap'... remote: Counting objects: 655, done. remote: Total 655 (delta 0), reused 0 (delta 0), pack-reused 655 Receiving objects: 100% (655/655), 142.85 KiB | 870.00 KiB/s, done. Resolving deltas: 100% (325/325), done.

Slide 16

Slide 16 text

branch

Slide 17

Slide 17 text

$ git branch * master

Slide 18

Slide 18 text

$ git branch testing

Slide 19

Slide 19 text

$ git branch * master testing

Slide 20

Slide 20 text

$ git checkout testing Switched to branch 'testing'

Slide 21

Slide 21 text

$ git branch master * testing

Slide 22

Slide 22 text

commit

Slide 23

Slide 23 text

https://github.com/GitInPractice/GitInPractice/blob/master/ D-WhyUseVersionControl.adoc#version-control-workflow

Slide 24

Slide 24 text

https://github.com/GitInPractice/GitInPractice/blob/master/01- LocalGit.adoc#creating-a-new-commit-git-add-git-commit

Slide 25

Slide 25 text

$ git status On branch testing Untracked files: (use "git add ..." to include in what will be committed) testing.txt nothing added to commit but untracked files present (use "git add" to track)

Slide 26

Slide 26 text

$ git add testing.txt

Slide 27

Slide 27 text

$ git status On branch testing Changes to be committed: (use "git reset HEAD ..." to unstage) new file: testing.txt

Slide 28

Slide 28 text

$ git commit -m "add test plan" [testing 82b9fdf] add test plan 1 file changed, 1 insertion(+) create mode 100644 testing.txt

Slide 29

Slide 29 text

push

Slide 30

Slide 30 text

$ git push fatal: The current branch testing has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin testing

Slide 31

Slide 31 text

$ git push --set-upstream origin testing Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. To https://github.com/MikeMcQuaid/strap * [new branch] testing -> testing Branch 'testing' set up to track remote branch 'testing' from 'origin'.

Slide 32

Slide 32 text

$ git push Everything up-to-date

Slide 33

Slide 33 text

pull request

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

https://github.com/MikeMcQuaid/strap/pull/139

Slide 37

Slide 37 text

https://github.com/MikeMcQuaid/strap/pull/139/files

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

merge

Slide 41

Slide 41 text

https://github.com/MikeMcQuaid/strap/pull/125

Slide 42

Slide 42 text

pull

Slide 43

Slide 43 text

$ git fetch remote: Counting objects: 1, done. remote: Total 1 (delta 0), reused 1 (delta 0), pack-reused 0 Unpacking objects: 100% (1/1), done. From https://github.com/Homebrew/homebrew-php 213dbf0d..6ec9064d master -> origin/master

Slide 44

Slide 44 text

git pull = git fetch && git merge

Slide 45

Slide 45 text

git pull --rebase = git fetch && git rebase

Slide 46

Slide 46 text

$ git pull remote: Counting objects: 31, done. remote: Compressing objects: 100% (3/3), done. remote: Total 31 (delta 22), reused 25 (delta 22), pack-reused 6 Unpacking objects: 100% (31/31), done. From https://github.com/Homebrew/homebrew-core c62c972697..2e9eb43456 master -> origin/master Updating c62c972697..2e9eb43456 Fast-forward Formula/app-engine-go-64.rb | 4 ++-- Formula/irssi.rb | 10 +++++----- Formula/mpir.rb | 44 ++++++++++++++++++++++++++++++++++ Formula/nordugrid-arc.rb | 2 +- Formula/phantomjs.rb | 4 ++-- 5 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 Formula/mpir.rb

Slide 47

Slide 47 text

repeat

Slide 48

Slide 48 text

help

Slide 49

Slide 49 text

$ git help diff $ git diff --help

Slide 50

Slide 50 text

https://github.com/GitInPractice/GitInPractice

Slide 51

Slide 51 text

http://mikemcquaid.com/talks/advanced-git-and-github/

Slide 52

Slide 52 text

@MikeMcQuaid mike@mikemcquaid.com https://mikemcquaid.com

Slide 53

Slide 53 text

questions?