28
Git/Github/Bitbucket @Shopify

Git/Github/Bitbucket@TalkIt. Humber college

Embed Size (px)

Citation preview

Page 1: Git/Github/Bitbucket@TalkIt. Humber college

Git/Github/Bitbucket@Shopify

Page 2: Git/Github/Bitbucket@TalkIt. Humber college

Aug. 15, 2005160,628 commits412 contributors

Page 3: Git/Github/Bitbucket@TalkIt. Humber college

328 commits on Jan 21by 63 devs

Page 4: Git/Github/Bitbucket@TalkIt. Humber college

Best Practices + Workflows + Tools

Page 5: Git/Github/Bitbucket@TalkIt. Humber college

Maintain a single source repositoryEveryone commits daily***

Automate the buildMake the build self-testing

Keep the build fast :(Make it easy to get latest version

Thanks to Martin Fowler

Page 6: Git/Github/Bitbucket@TalkIt. Humber college

Folders as Source Code Control System

Project1/...Project1.backup/…Project1.20150114/...

Page 7: Git/Github/Bitbucket@TalkIt. Humber college

Concurrent Versions System (CVS)versioning per file

branching is expensivecommits are not atomic

Page 8: Git/Github/Bitbucket@TalkIt. Humber college

A project in CVS

readme.txt | 1.1 | 1.2

main.c | 1.1 | 1.2 | 1.3 | 1.4

license.txt | 1.1

Page 9: Git/Github/Bitbucket@TalkIt. Humber college

Subversion (svn)file rename = copy + delete

branches and tags are expensive

Page 10: Git/Github/Bitbucket@TalkIt. Humber college

Everyone commits dailyIs the build broken?

Does a commit make sense?Who is going to solve merge conflicts?

Page 11: Git/Github/Bitbucket@TalkIt. Humber college

GitIt’s distributed

Your history is almost localMerging is good

Page 12: Git/Github/Bitbucket@TalkIt. Humber college

Git = low level commands+ high level tools

Page 13: Git/Github/Bitbucket@TalkIt. Humber college

git help -a …. (157 total)add, fsck, reflog, add--interactive, fsck-objects, relink, am, gc, remote, annotate, get-tar-commit-id, remote-ext, apply, grep, remote-fd, archimport, gui--askpass, remote-ftp, archive, hash-object, remote-ftps, bisect, help, remote-http, bisect--helper, http-backend, remote-https, blame, http-fetch, remote-testsvn, branch, http-push, repack, bundle, imap-send, replace, cat-file, index-pack, request-pull, check-attr, init, rerere, check-ignore, init-db, reset, check-mailmap, instaweb, rev-list, check-ref-format, interpret-trailers, rev-parse, checkout, log, revert, checkout-index, ls-files, rm, cherry, ls-remote, send-email, cherry-pick, ls-tree, send-pack, citool, mailinfo, sh-i18n--envsubst, clean, mailsplit, shell, clone, merge, shortlog, column, merge-base, show, commit, merge-file, show-branch, commit-tree, merge-index, show-index, config, merge-octopus, show-ref, count-objects, merge-one-file, stage, credential, merge-ours, stash, credential-cache, merge-recursive, status, credential-cache--daemon, merge-resolve, stripspace, credential-osxkeychain, merge-subtree, submodule, credential-store, merge-tree, subtree, cvsexportcommit, mergetool, svn, cvsimport, mktag, symbolic-ref, cvsserver, mktree, tag, daemon, mv, unpack-file, describe, name-rev, unpack-objects, diff, notes, update-index, diff-files, p4, update-ref, diff-index, pack-objects, update-server-info, diff-tree, pack-redundant, upload-archive, difftool, pack-refs, upload-pack, difftool--helper, patch-id, var, fast-export, prune, verify-commit, fast-import, prune-packed, verify-pack, fetch, pull, verify-tag, fetch-pack, push, web--browse, filter-branch, quiltimport, whatchanged, fmt-merge-msg, read-tree, write-tree, for-each-ref, rebase, format-patch, receive-pack

Page 14: Git/Github/Bitbucket@TalkIt. Humber college

status

add

commit

rebase -i

checkout -b

fetch

push

Page 15: Git/Github/Bitbucket@TalkIt. Humber college

git shortlog -s -n --after="2015-01-21 00:00" --before="2015-01-21 23:59"

Page 16: Git/Github/Bitbucket@TalkIt. Humber college

GithubIssues

Automated tests integration

Page 17: Git/Github/Bitbucket@TalkIt. Humber college

Github Pull RequestsLet other people know about upcoming changes

Page 18: Git/Github/Bitbucket@TalkIt. Humber college

Commit often,Perfect later,Publish once

LMGTFY: git best practices

Page 19: Git/Github/Bitbucket@TalkIt. Humber college

RefactoringChanging existing code without changing

its external behaviour.

Page 20: Git/Github/Bitbucket@TalkIt. Humber college

git rebase -i

Page 21: Git/Github/Bitbucket@TalkIt. Humber college

Bitbucket

Page 22: Git/Github/Bitbucket@TalkIt. Humber college

Git is a key-value storage

Page 23: Git/Github/Bitbucket@TalkIt. Humber college

Git = commits + trees + files

Page 24: Git/Github/Bitbucket@TalkIt. Humber college

040000 tree d8329fc1cc938780ffdd9f94e0d364e0ea74f579 bak

100644 blob fa49b077972391ad58037050f2a75f74e3671e92 new.txt

100644 blob 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt

Tree Object

Page 25: Git/Github/Bitbucket@TalkIt. Humber college

tree d8329fc1cc938780ffdd9f94e0d364e0ea74f579

author Scott Chacon <[email protected]> 1243040974 -0700

committer Scott Chacon <[email protected]> 1243040974 -0700

first commit

Commit Object

Page 26: Git/Github/Bitbucket@TalkIt. Humber college

Github pages

Page 27: Git/Github/Bitbucket@TalkIt. Humber college

● Use github & bitbucket

● Commit often

● Branch per feature

● Rewrite your history

Page 28: Git/Github/Bitbucket@TalkIt. Humber college

Thanks!

Andrew Romanenco

[email protected]

January, 2016