33
Git and GitHub Lifting ourselves out of SVN Sebastiaan Deckers November 2011

Git and git hub

Embed Size (px)

Citation preview

Page 1: Git and git hub

Git and GitHubLifting ourselves out of SVN

Sebastiaan DeckersNovember 2011

Page 2: Git and git hub

What's wrong with SVN?Git is just better.

Page 3: Git and git hub

Features● Cheap Local

Branching● Everything is Local● Git is Fast● Git is Small● The Staging Area● Distributed● GitHub● Easy to Learn

Workflow● Subversion-Style

Workflow● Integration

Manager Workflow● Dictator and

Lieutenants Workflow

http:// Why Git Is Better Than X .com/

Page 4: Git and git hub

Windows: TortoiseGitMac: Github.app, Tower ($59)

Git clients?

Page 5: Git and git hub

WorkflowAdd source code files so that Git tracks them

in the local repository.Commit your changed files to the local repo.

Push to upload your commits to GitHub.Pull to get commits from GitHub.

Page 6: Git and git hub

Command Line

Page 7: Git and git hub

git help <command>Your friendly neighbourhood documentation.

addcommit

pull fetch

push

etc...

Page 8: Git and git hub

svn checkout <url> <dir> git clone <url> <dir>

Full revision history

No single point of failure

Fast transfer speed

... but wait, it's better!

Page 9: Git and git hub

svn update git pull <remote> <branch>

Merge branches

Each developer has their own remote

Hack together without affecting others

... but wait, it's better!

Page 10: Git and git hub

svn add git add --all

Just kidding. It's pretty much the same.

But add also used to mark merge conflicts

as resolved.

... but wait, it's better!

Page 11: Git and git hub

svn commit git push <remote> <branch>

As with pull, you can push to anywhere.

... but wait, it's better!

Page 12: Git and git hub

What is this I don't even...

Page 13: Git and git hub

remote≈ SVN repository URL

A remote is a bookmark of another Git repository.

It represents a Git repo by its URL.The default remote is called "origin".

The origin remote has no special meaning and is merely convention.

Page 14: Git and git hub

refspec≈ SVN branch name

A refspec is the name of a branch or tag, or the SHA-1 of a particular commit.

The default refspec is called "master".The master refspec has no special meaning

and is merely convention.

Page 15: Git and git hub

commit≈ SVN revision/commit

Changes to files are identified by a SHA-1 hash.

Can usually be referenced by the first few characters.

Allows Git to do fast comparisions, error checking, compact storage.

Page 16: Git and git hub

Commit Log

Page 17: Git and git hub

git log

commit 4f94c3059851fedce2d92f19af98d67ec8c2be69Author: Thomas Gorissen <[email protected]>Date: Wed Nov 2 09:23:41 2011 +0000

Changed date interpretation to adapt server change

git-svn-id: https://subversion.assembla.com/svn/adz/uinew@4672 3c9e7dd8-c376-4c09-bcd8-96044d63829d

Page 18: Git and git hub

git log --oneline

4f94c30 Changed date interpretation to adapt server change501753c Fixing creative click tracking testcce1c63 Changing maximum bid to bid-price23aad1c Override the aggregated status with only the primary status.4b2f730 Increased version number to 1.5.584aed45 Show the filter ID when a name is missing5ae3f2f not overriding backup picture with old one on upload38af93b removing now unnecessary code to reference backupID7dac9c0 Redirecting user to #Home if he doesn't accept terms02afc23 Added ISO date parsingb30d440 Changed sessionTimeout to be understood as secondsa57adf0 Not querying for rejected creatives on select popup in CIbc4c93a Recursively apply the active selection on search results7ad1401 Highlighting error fields on credit limit change

Page 19: Git and git hub

git log --grep=refactoring

3b9c48e Preparations for Tree control refactoringd3f32f9 Code cleanup/ refactoringb7d58d0 Minor code refactoring83a2235 Minor refactoring for improved trickeryba83e28 Massive refactoring of the filters control. Now supports disabling entire menu sections on-the-fly.98e9232 Lots of refactoring to show Pending Approvals as a widget anywhere

Page 20: Git and git hub

git log --author=seb

23aad1c Override the aggregated status with only the primary status.6a9f696 Fixed showing the platform support dagger symbol on search results84aed45 Show the filter ID when a name is missing78a9948 Asynchronous rendering with a loading indicator for audience template loading/savingbc4c93a Recursively apply the active selection on search resultsedb35be Fixed recursive selection to activate all parentscbe9542 Removed dead code :)

Page 21: Git and git hub

Branching

Page 22: Git and git hub

git branch

List, create, or delete branchesWarning: Does not switch branch! #wtfgit

Page 23: Git and git hub

git checkout [-b] <branchname>

Creates a new branch and switches to it.

Page 24: Git and git hub

git merge <branchname>

Merges branchname into the current branch.

Page 26: Git and git hub

GitHub

Page 27: Git and git hub

Commit HistoryWho's doing what

Page 28: Git and git hub
Page 29: Git and git hub

Pull RequestsCode review and collaboration

Page 30: Git and git hub
Page 31: Git and git hub

Crazy Stats

Page 32: Git and git hub
Page 33: Git and git hub

Questions?RTFM

http://book.git-scm.com/http://help.github.com/