git and git hub
TRANSCRIPT
Git and GitHubLifting ourselves out of SVN
Sebastiaan DeckersNovember 2011
What's wrong with SVN?Git is just better.
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/
Windows: TortoiseGitMac: Github.app, Tower ($59)
Git clients?
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.
Command Line
git help <command>Your friendly neighbourhood documentation.
addcommit
pull fetch
push
etc...
svn checkout <url> <dir> git clone <url> <dir>
Full revision history
No single point of failure
Fast transfer speed
... but wait, it's better!
svn update git pull <remote> <branch>
Merge branches
Each developer has their own remote
Hack together without affecting others
... but wait, it's better!
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!
svn commit git push <remote> <branch>
As with pull, you can push to anywhere.
... but wait, it's better!
What is this I don't even...
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.
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.
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.
Commit Log
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
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
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
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 :)
Branching
git branch
List, create, or delete branchesWarning: Does not switch branch! #wtfgit
git checkout [-b] <branchname>
Creates a new branch and switches to it.
git merge <branchname>
Merges branchname into the current branch.
Branching Examplehttp://book.git-scm.
com/3_basic_branching_and_merging.html
GitHub
Commit HistoryWho's doing what
Pull RequestsCode review and collaboration
Crazy Stats
Questions?RTFM
http://book.git-scm.com/http://help.github.com/