Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Objective-J Git Wrapper
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

objj-git: A Git Wrapper for Objective-J

Example Usage

Create the Git object: var git = [Git gitWithDirectory:@"/path/to/git/repo"];

Clone a repository: [git clone:@"remote/repo/URL"];

Init a repository: [git init]; this also creates the directory if it doesn't exist.

Enable a single retry on command failure: [git setRetry:YES];

Enable debug logging: CPLogRegister(CPLogPrint, @"trace"); (All log messages are made at either the debug or trace levels.)

Passing options to a command: [git diff:@"HEAD", @"HEAD^" name_status:YES]; or: [git diff:[@"HEAD", @"HEAD^"] name_status:YES]; or: [git diff:[@"HEAD", @"HEAD^", @"--name-status"]]; or: [git diff:nil, [@"HEAD", @"HEAD^", @"--name-status"]]; (nil/null is just ignored)

Usage Notes

Selector parts (like the name_status in the first two examples above) get converted to command-line arguments: [git commit:@"-a" amend:YES m:@"commit message" author:@"some dude"]; becomes: 'git' 'commit' '-a' '--amend' '-m' 'commit message' '--author=some dude'

while: [git commit:@"-a" amend:NO message:@"commit message"]; becomes: 'git' 'commit' '-a' '--message=commit message'

of course, in that case you can leave off amend: entirely: [git commit:@"-a" message:@"commit message"]; also becomes: 'git' 'commit' '-a' '--message=commit message'

Unit Tests

jake test

runs OJTest and OJCov for all the unit tests. See the README of if you don't have OJTest.

Please make sure all contributions come with appropriate unit tests. Every fixed bug should have a test made for it so we can make sure it doesn't come back.

Something went wrong with that request. Please try again.