Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Saturday, April 18, 2009

Distributed Version Control & Git [Part 2]

dvcs.png
In Part I of Distributed Version Control & Git, I showed you why you should switch to Distributed Version Control and explained part of what makes Git a compelling Distributed Version Control System. In Part 2 and the final part of this miniseries, I show you an overview of git and the basics and guide you through how you setup a git repository, doing commits, branches, merging, resolving merge conflicts with filemerge and show you the apps that come with git and GitX. I also want to draw your attention to the fact that there are some excellent & much more detailed git tutorial videos that go into much more detail at GitCasts Here are some more interesting resources GitX GitCast Videos Setup Initialization & Cloning Normal Workflow Interactive Adding Git Log Browsing Git Objects Branching & Merging Rebasing Distributed Workflow Empty Branches RailsConf Git Talk Git Submodules Git Diff

Monday, April 13, 2009

Distributed Version Control & Git [Part 1]

dvcs.png
This is a video based off a talk I gave on Distributed Version Control for the Des Moines Cocoaheads and gave an example of how to use it in the context of git. The premise of my talk was showing why you should switch to distributed version control and showing off some cool things it can do. Today I seriously believe that with few rare exceptions do we really need centralized version control, in addition Subversions merging is broken and these distributed systems tend to do branching & merging in a much more pleasant manner that actually makes things enjoyable. Literally when you start using Distributed Version Control you tend to start making a lot of branches and do many more merges, it becomes you do commits and merges when you want to vs doing them in some regularity because you fear your version control system might make things harder if you don't commit or merge now. Check in later for Part 2 where I demonstrate some features in git in another screencast... for now here are some things to get you started Git Homepage The way I'd recommend people install Git Git OS X Installer (Google Code Project) Git Cheat Sheet Gitx App Pragmatic Programmers: Pragmatic Version Control Using Git [Book] Linus Torvalds Google Tech Talk on Git Randal Scwartz Google Tech Talk on Git

Thursday, June 19, 2008

One GIT Build Script to Rule them all

There seem to be at least 2 camps of GIT Users on OS X, those who installed git with the Mac OS X Package installer and those who installed it from Mac Ports. On my new project Gitty (a Git Repo inspector/manager just beginning development), I didn't want to discriminate, but at the same time I didn't know perl well enough to modify Marcus Zarra's Build Script beyond changing /opt/local/bin/git to /usr/local/git/bin/git. However one of my followers on Twitter was kind enough to modify the perl build script that sticks part of the GIT Hash in the about box to search for both locations and use which ever one you have installed so that it is now GIT Location Agnostic. It looks for the standard install location first and then if It can't find that searches for the MacPorts git install location and uses that. This works great for me and so i thought i'd share... enjoy. Thanks

# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Updated to use git in the Standard Install Location or the MacPorts
#   install location by Patrick Burleson
 
use strict;
 
# Get the current git commit hash and use it to set the CFBundleVersion value
my $REV = "";

if( -e "/usr/local/git/bin/git" ) 
{
    $REV = `/usr/local/git/bin/git show --abbrev-commit | grep "^commit"`;
}
elsif ( -e "/opt/local/bin/git" )
{
    $REV = `/opt/local/bin/git show --abbrev-commit | grep "^commit"`;
}
else 
{
    die "Git not found";
}

my $INFO = "$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Contents/Info.plist";
 
my $version = $REV;
if( $version =~ /^commit\s+([^.]+)\.\.\.$/ )
{ 
    $version = $1;
}
else
{
    $version = undef;
}
die "$0: No Git revision found" unless $version;
 
open(FH, "$INFO") or die "$0: $INFO: $!";
my $info = join("", <FH>);
close(FH);
 
$info =~ s/([\t ]+<key>CFBundleVersion<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version$2/;
 
open(FH, ">$INFO") or die "$0: $INFO: $!";
print FH $info;
close(FH);

 
...