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
250
Hexes, Charms and Spells
jadeallenx
0
150
3 > 2
jadeallenx
0
950
Idiomatic Erlang
jadeallenx
0
150
The Sharp Edges of Leaky Abstractions
jadeallenx
0
97
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
210
Other Decks in Technology
See All in Technology
Datadogとともにオブザーバビリティを布教しよう
mego2221
0
130
The 5 Obstacles to High-Performing Teams
mdalmijn
0
270
データの品質が低いと何が困るのか
kzykmyzw
6
1k
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1.2k
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
500
偶然 × 行動で人生の可能性を広げよう / Serendipity × Action: Discover Your Possibilities
ar_tama
1
740
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.1k
まだ間に合う! エンジニアのための生成AIアプリ開発入門 on AWS
minorun365
PRO
4
580
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
1
110
PL900試験から学ぶ Power Platform 基礎知識講座
kumikeyy
0
110
RSNA2024振り返り
nanachi
0
500
10分で紹介するAmazon Bedrock利用時のセキュリティ対策 / 10-minutes introduction to security measures when using Amazon Bedrock
hideakiaoyagi
0
170
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Done Done
chrislema
182
16k
What's in a price? How to price your products and services
michaelherold
244
12k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Facilitating Awesome Meetings
lara
51
6.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
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?!