Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intro to Git for the Python Hacker
Search
Jade Allen
September 14, 2012
Technology
4
340
Intro to Git for the Python Hacker
A gentle introduction to git for a python programmer
Jade Allen
September 14, 2012
Tweet
Share
More Decks by Jade Allen
See All by Jade Allen
All About Regular Expressions
jadeallenx
1
240
Hexes, Charms and Spells
jadeallenx
0
150
3 > 2
jadeallenx
0
940
Idiomatic Erlang
jadeallenx
0
140
The Sharp Edges of Leaky Abstractions
jadeallenx
0
96
Sagas: Distributed Transactions Without Locks
jadeallenx
0
560
Before Unix: Early History of Time-Sharing
jadeallenx
0
200
Functional Programming Made Me a Better Perl Developer
jadeallenx
1
350
Assigning Meanings to Programs
jadeallenx
0
200
Other Decks in Technology
See All in Technology
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.5k
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
490
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.7k
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
320
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
5
200
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
270
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
110
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
270
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
290
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
How STYLIGHT went responsive
nonsquared
95
5.2k
Mobile First: as difficult as doing things right
swwweet
222
9k
Designing for Performance
lara
604
68k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Practical Orchestrator
shlominoach
186
10k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Transcript
Intro to Git! for Python Hackers! ! ! Mark Allen!
[email protected]
! @bytemeorg! http://byte-me.org! https://github.com/mrallen1!
Distributed ! Version ! Control! System!
Fast! !
Tons of features! !
Pervasive use in the community!
Worst. Interface. Evar.!
1. Terms and lingo! 2. Basic workflow! 3. Topic branches!
4. Starting and/or contributing to github projects.! 5. Cool Python stuff!
Terms / Lingo http://marklodato.github.com/visual-git-guide/index-en.html!
Terms / Lingo http://marklodato.github.com/visual-git-guide/index-en.html!
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!
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
I want to...! !create a new local repository! $ mkdir
myproject! $ cd myproject! $ git init! Basics
I want to...! ! ! !copy a remote repository! !
$ git clone https://example.com! $ git clone
[email protected]
:project.git! Basics
I want to...! ! ! !stage a file for a
commit! ! $ git add -- myfile.py! Basics
I want to...! create a commit! ! $ git commit!
Basics
I want to...! add to the last commit! ! $
git commit --amend! Basics
I want to...! ! ! diff against a commit! !
$ git diff! $ git diff HEAD^! $ git diff HEAD~4! $ git diff 1bc38 -- myfile.py! Basics
I want to...! ! ! ! see commit history! !
$ git log! Basics
I want to...! ! ! !update a local repository! !
$ git pull! Basics
I want to...! give a commit a memorable reference! !
$ git tag mytag 1bec3! $ git push --tags! $ git diff mytag -- a.py! Basics
I want to...! add a remote storage location! ! $
git remote add origin https://example.com! ! -also-! ! $ git remote rm origin! Basics
I want to...! push my local work to a remote
location! ! $ git push! $ git push -u origin foo! Basics
I want to...! temporarily save my work and work on
something else! $ git stash! # ...! $ git stash pop! Basics
Git commands ! • are (mostly) scripts! • bash, python,
perl! • you can extend!
Topic branches! ! • What are they?! • Why are
they useful?! • How do you use them?! Topic branches
$ git branch rt14322! $ git checkout rt14322! -or-! $
git checkout -b rt14322! ...! Topic branches
$ git checkout master! $ git merge rt14322! Topic branches
GitHub
GitHub
GitHub https://github.com/signup/free!
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub Congratulations, your pull request was submitted!! ! Things to
do now:! • Relax! • Have a tasty beverage! • Enjoy the accolades of a grateful Python community!
Augh! My library is in CVS or SVN!! • I'm
sorry for your pain.! • Github has tools and guides to help you migrate!
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
Cool Python Stuff! • pygit2 - Python binding for libgit2
(an alternative C implementation)! • git-cola - a graphical git client written in Python! Python
Thank you!! Questions?!