Slide 1

Slide 1 text

Intro to Git! for Python Hackers! ! ! Mark Allen! [email protected]! @bytemeorg! http://byte-me.org! https://github.com/mrallen1!

Slide 2

Slide 2 text

Distributed ! Version ! Control! System!

Slide 3

Slide 3 text

Fast! !

Slide 4

Slide 4 text

Tons of features! !

Slide 5

Slide 5 text

Pervasive use in the community!

Slide 6

Slide 6 text

Worst. Interface. Evar.!

Slide 7

Slide 7 text

1.  Terms and lingo! 2.  Basic workflow! 3.  Topic branches! 4.  Starting and/or contributing to github projects.! 5.  Cool Python stuff!

Slide 8

Slide 8 text

Terms / Lingo http://marklodato.github.com/visual-git-guide/index-en.html!

Slide 9

Slide 9 text

Terms / Lingo http://marklodato.github.com/visual-git-guide/index-en.html!

Slide 10

Slide 10 text

Basics subversion! ! $ svn co \! https://example.com! $ vim myfile.py! $ svn status! $ svn diff! $ svn ci -m'My commit'! git! ! $ git clone \! https://example.com! $ vim myfile.py! $ git status! $ git add -- myfile.py! $ git diff! $ git commit \! -m'My commit'! $ git push!

Slide 11

Slide 11 text

Basics ! $ git clone https://example.com! $ vim myfile.py! $ git diff! $ git add myfile.py ! $ git status! $ git commit -m'My commit'! $ git push origin master! origin   Where   What  

Slide 12

Slide 12 text

I want to...! !create a new local repository! $ mkdir myproject! $ cd myproject! $ git init! Basics

Slide 13

Slide 13 text

I want to...! ! ! !copy a remote repository! ! $ git clone https://example.com! $ git clone [email protected]:project.git! Basics

Slide 14

Slide 14 text

I want to...! ! ! !stage a file for a commit! ! $ git add -- myfile.py! Basics

Slide 15

Slide 15 text

I want to...! create a commit! ! $ git commit! Basics

Slide 16

Slide 16 text

I want to...! add to the last commit! ! $ git commit --amend! Basics

Slide 17

Slide 17 text

I want to...! ! ! diff against a commit! ! $ git diff! $ git diff HEAD^! $ git diff HEAD~4! $ git diff 1bc38 -- myfile.py! Basics

Slide 18

Slide 18 text

I want to...! ! ! ! see commit history! ! $ git log! Basics

Slide 19

Slide 19 text

I want to...! ! ! !update a local repository! ! $ git pull! Basics

Slide 20

Slide 20 text

I want to...! give a commit a memorable reference! ! $ git tag mytag 1bec3! $ git push --tags! $ git diff mytag -- a.py! Basics

Slide 21

Slide 21 text

I want to...! add a remote storage location! ! $ git remote add origin https://example.com! ! -also-! ! $ git remote rm origin! Basics

Slide 22

Slide 22 text

I want to...! push my local work to a remote location! ! $ git push! $ git push -u origin foo! Basics

Slide 23

Slide 23 text

I want to...! temporarily save my work
 and work on something else! $ git stash! # ...! $ git stash pop! Basics

Slide 24

Slide 24 text

Git commands ! •  are (mostly) scripts! •  bash, python, perl! •  you can extend!

Slide 25

Slide 25 text

Topic branches! ! •  What are they?! •  Why are they useful?! •  How do you use them?! Topic branches

Slide 26

Slide 26 text

$ git branch rt14322! $ git checkout rt14322! -or-! $ git checkout -b rt14322! ...! Topic branches

Slide 27

Slide 27 text

$ git checkout master! $ git merge rt14322! Topic branches

Slide 28

Slide 28 text

GitHub

Slide 29

Slide 29 text

GitHub

Slide 30

Slide 30 text

GitHub https://github.com/signup/free!

Slide 31

Slide 31 text

GitHub

Slide 32

Slide 32 text

GitHub

Slide 33

Slide 33 text

GitHub

Slide 34

Slide 34 text

GitHub

Slide 35

Slide 35 text

GitHub

Slide 36

Slide 36 text

GitHub

Slide 37

Slide 37 text

GitHub

Slide 38

Slide 38 text

GitHub

Slide 39

Slide 39 text

GitHub

Slide 40

Slide 40 text

GitHub

Slide 41

Slide 41 text

GitHub

Slide 42

Slide 42 text

GitHub

Slide 43

Slide 43 text

GitHub

Slide 44

Slide 44 text

GitHub

Slide 45

Slide 45 text

GitHub

Slide 46

Slide 46 text

GitHub

Slide 47

Slide 47 text

GitHub

Slide 48

Slide 48 text

GitHub

Slide 49

Slide 49 text

GitHub

Slide 50

Slide 50 text

GitHub

Slide 51

Slide 51 text

GitHub

Slide 52

Slide 52 text

GitHub

Slide 53

Slide 53 text

GitHub

Slide 54

Slide 54 text

GitHub

Slide 55

Slide 55 text

GitHub

Slide 56

Slide 56 text

GitHub

Slide 57

Slide 57 text

GitHub

Slide 58

Slide 58 text

GitHub

Slide 59

Slide 59 text

GitHub Congratulations, your pull request was submitted!! ! Things to do now:! • Relax! • Have a tasty beverage! • Enjoy the accolades of a grateful Python community!

Slide 60

Slide 60 text

Augh! My library is in CVS or SVN!! •  I'm sorry for your pain.! •  Github has tools and guides to help you migrate!

Slide 61

Slide 61 text

Cool Python Stuff! •  dulwich, a pure python git implementation! •  GitPython, wraps git command line tools! •  Legit, a more humane git CLI (by Kenneth Reitz)! Python

Slide 62

Slide 62 text

Cool Python Stuff! •  pygit2 - Python binding for libgit2 (an alternative C implementation)! •  git-cola - a graphical git client written in Python! Python

Slide 63

Slide 63 text

Thank you!! Questions?!