# ObjectiveGit
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Build Status](https://travis-ci.org/libgit2/objective-git.svg?branch=master)](https://travis-ci.org/libgit2/objective-git)
ObjectiveGit provides Cocoa bindings to the
[libgit2](https://github.com/libgit2/libgit2) library, packaged as a dynamic framework for OS X and iOS 8 or better.
## Features
A brief summary of the available functionality:
* Read: log, diff, blame, reflog, status
* Write: init, checkout, commit, branch, tag, reset
* Internals: configuration, tree, blob, object database
* Network: clone, fetch, push, pull
* Transports: HTTP, HTTPS, SSH, local filesystem
Not all libgit2 features are available, but if you run across something missing, please consider [contributing a pull request](#contributing)!
Many classes in the ObjectiveGit API wrap a C struct from libgit2 and expose the underlying data and operations using Cocoa idioms. The underlying libgit2 types are prefixed with `git_` and are often accessible via a property so that your application can take advantage of the [libgit2 API](https://libgit2.github.com/libgit2/#HEAD) directly.
The ObjectiveGit API makes extensive use of the Cocoa NSError pattern. The public API is also decorated with nullability attributes so that you will get compile-time feedback of whether nil is allowed or not. This also makes the framework much nicer to use in Swift.
## Getting Started
### Xcode
ObjectiveGit requires Xcode 7 or greater to build the framework and run unit tests. Projects that must use an older version of Xcode can use
[Carthage](#carthage) to install pre-built binaries
or download them [manually](#manually).
### Other Tools
Simply run the [`script/bootstrap`](script/bootstrap) script to automatically install
dependencies needed to start building the framework. This script uses
[Homebrew](http://brew.sh) to install these tools. If your Mac does not have
Homebrew, you will need to install the following manually:
- [cmake](https://github.com/Kitware/CMake)
- libtool
- autoconf
- automake
- pkg-config
- libssh2
- symlinks: lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h
To develop ObjectiveGit on its own, open the `ObjectiveGitFramework.xcworkspace` file.
# Installation
There are three ways of including ObjectiveGit in a project:
1. [Carthage](#carthage) <-- recommended
1. [Manual](#manual)
1. [Subproject](#subproject)
## Carthage
1. Add ObjectiveGit to your [`Cartfile`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).
```
github "libgit2/objective-git"
```
1. Run `carthage update`.
1. **Mac targets**
* On your application targets' "General" settings tab, in the "Embedded Binaries" section, drag and drop the `ObjectiveGit.framework` from the [`Carthage/Build/Mac`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#carthagebuild) folder on disk.
![Embedded Binaries](http://i.imgur.com/W9EVyIX.png)
1. **iOS targets**
* On your application targets' "General" settings tab, in the "Linked Frameworks and Libraries" section, drag and drop the `ObjectiveGit.framework` from the [`Carthage/Build/iOS`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#carthagebuild) folder on disk.
![Linked Frameworks](http://i.imgur.com/y4caRw0.png)
* On your application targets' "Build Phases" settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:
```
/usr/local/bin/carthage copy-frameworks
```
and add the paths to the frameworks you want to use under “Input Files”, e.g.:
```
$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework
```
![Carthage Copy Frameworks](http://i.imgur.com/zXai6rb.png)
1. Commit the [`Cartfile.resolved`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfileresolved)
2. Under “Build Settings”, add the following to “Header Search Paths”: `$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/` to avoid [`git2/filter.h file not found` errors](https://github.com/libgit2/objective-git/issues/441).
The different instructions for iOS works around an [App Store submission bug](http://www.openradar.me/radar?id=6409498411401216) triggered by universal binaries.
### Copying debug symbols for debugging and crash reporting
_dSYM files are not currently included in the GitHub release zip files. You will need to pass **--no-use-binaries** to carthage in order to build locally and generate the dSYM files alongside the framework._
1. On your application target's "Build Phases" settings tab, click the "+" icon and choose "New Copy Files Phase".
2. Click the “Destination” drop-down menu and select "Products Directory".
3. Drag and drop the `ObjectiveGit.framework.dSYM` file from `Carthage/Build/[platform]` into the list.
![Copy dSYM Files](http://i.imgur.com/WKJdHHQ.png)
## Manual
1. Download the latest `ObjectiveGit.framework.zip` from [releases](https://github.com/libgit2/objective-git/releases).
1. Unzip the file.
1. Follow the Carthage instructions #3 or #4, depending on platform.
Note that the iOS framework we release is a "fat" framework containing slices for both the iOS Simulator and devices. This makes it easy to get started with your iOS project. However, Apple does not currently allow apps containing frameworks with simulator slices to be submitted to the app store. Carthage (above) already has a solution for this. If you're looking to roll your own, take a look at Realm's [strip frameworks script](https://github.com/realm/realm-cocoa/blob/master/scripts/strip-frameworks.sh).
## Subproject
### Examples
* OS X: [CommitViewer](https://github.com/Abizern/CommitViewer)
* iOS: [ObjectiveGit iOS Example](https://github.com/Raekye/ObjectiveGit-iOS-Example)
1. Add ObjectiveGit as a submodule to your project:
```
git submodule add https://github.com/libgit2/objective-git.git External/ObjectiveGit
```
1. Run `script/bootstrap`.
1. Drag the `ObjectiveGitFramework.xcodeproj` file into the Project Navigator pane of your project.
1. Add `ObjectiveGit-Mac` or `ObjectiveGit-iOS` as a target dependency of your application, depending on platform.
1. Link your application with `ObjectiveGit.framework`.
1. Set the “Header Search Paths” (`HEADER_SEARCH_PATHS`) build setting to the correct path for the libgit2 headers in your project. For example, if you added the submodule to your project as `External/ObjectiveGit`, you would set this build setting to `External/ObjectiveGit/External/libgit2/include`. If you see build errors saying that `git2/filter.h` cannot be found, then double-check that you set this setting correctly.
1. Add a new "Copy Files" build phase, set the destination to "Frameworks" and add `ObjectiveGit.framework` to the list. This will package the framework with your application as an embedded private framework.
* It's hard to tell the difference between the platforms, but the Mac framework is in `build/Debug` whereas the iOS framework is in `build/Debug-iphoneos`
1. Don't forget to `#import <ObjectiveGit/ObjectiveGit.h>` or `@import ObjectiveGit;` as you would with any other framework.
## Contributing
1. Fork this repository
1. Make it awesomer (preferably in a branch named for the topic)
1. Send a pull request
All contributions should match GitHub's [Objective-C coding
conventions](https://github.com/github/objective-c-style-guide).
You can see all the amazing people that have contributed to this project
[here](https://github.com/libgit2/objective-git/graphs/contributors).
## License
ObjectiveGit is released under the MIT license. See
the [LICENSE](LICENSE) file.
没有合适的资源?快使用搜索试试~ 我知道了~
Objective-C bindings to libgit2.zip
共194个文件
m:93个
h:64个
plist:5个
需积分: 5 0 下载量 31 浏览量
2023-12-31
10:08:27
上传
评论
收藏 26.45MB ZIP 举报
温馨提示
Objective-C bindings to libgit2.zip
资源推荐
资源详情
资源评论
收起资源包目录
Objective-C bindings to libgit2.zip (194个子文件)
bootstrap 3KB
Cartfile 0B
cibuild 2KB
clean_externals 544B
.gitignore 170B
.gitignore 138B
.gitignore 21B
.gitmodules 778B
.gitmodules 102B
GTRepository.h 30KB
metamacros.h 30KB
GTDiff.h 15KB
GTIndex.h 9KB
GTEnumerator.h 7KB
GTRepository+Status.h 7KB
GTRepository+RemoteOperations.h 7KB
GTSubmodule.h 6KB
GTDiffDelta.h 6KB
GTReference.h 6KB
GTRemote.h 5KB
GTBranch.h 5KB
GTTreeBuilder.h 5KB
GTBlob.h 5KB
GTCheckoutOptions.h 5KB
GTRepository+Stashing.h 5KB
GTCredential.h 4KB
GTTree.h 4KB
NSError+Git.h 4KB
GTNote.h 4KB
EXTScope.h 3KB
GTObject.h 3KB
ObjectiveGit.h 3KB
GTIndexEntry.h 3KB
GTRepository+Merging.h 3KB
GTOID.h 3KB
GTFilter.h 3KB
GTTreeEntry.h 3KB
GTCommit.h 3KB
GTObjectDatabase.h 3KB
GTSignature.h 3KB
GTDiffPatch.h 3KB
GTFilterList.h 2KB
GTTag.h 2KB
GTDiffHunk.h 2KB
GTBlame.h 2KB
GTDiffFile.h 2KB
GTDiffLine.h 2KB
GTBlameHunk.h 2KB
GTFetchHeadEntry.h 2KB
GTRepository+Blame.h 2KB
GTFilterSource.h 2KB
GTReflog.h 2KB
GTRepository+Committing.h 2KB
NSString+Git.h 1KB
GTConfiguration.h 1KB
QuickSpec+GTFixtures.h 1KB
GTRepository+Reset.h 1KB
GTRepository+Pull.h 1KB
GTStatusDelta.h 1KB
GTCredential+Private.h 1KB
NSDate+GTTimeAdditions.h 1KB
GTOdbObject.h 1KB
NSData+Git.h 1KB
NSArray+StringArray.h 899B
GTReflogEntry.h 754B
GTReflogEntry+Private.h 673B
GTUtilityFunctions.h 663B
GTRepository+Attributes.h 620B
GTRepository+References.h 604B
GTConfiguration+Private.h 600B
GTDiff+Private.h 565B
GTRepository+Private.h 460B
GTReflog+Private.h 256B
LICENSE 1KB
GTRepository.m 37KB
GTRepositorySpec.m 32KB
GTIndexSpec.m 13KB
GTIndex.m 12KB
GTRepository+RemoteOperations.m 12KB
GTDiffSpec.m 11KB
GTDiff.m 11KB
GTRepository+PullSpec.m 11KB
GTBranchSpec.m 10KB
GTSubmoduleSpec.m 10KB
GTRepository+Merging.m 9KB
GTRepositoryStashingSpec.m 8KB
GTBranch.m 8KB
GTReference.m 8KB
GTEnumerator.m 7KB
GTReferenceSpec.m 7KB
GTFilterListSpec.m 7KB
GTDiffDelta.m 7KB
GTRemoteSpec.m 7KB
GTRemotePushSpec.m 6KB
GTRemote.m 6KB
GTFilter.m 6KB
QuickSpec+GTFixtures.m 6KB
GTFilterSpec.m 6KB
GTRepository+StatusSpec.m 6KB
GTSubmodule.m 5KB
共 194 条
- 1
- 2
资源评论
暮苍梧~
- 粉丝: 41
- 资源: 258
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Android面试题.txt
- chujuyingshi1129802.apk
- 865804808983585自动化办公必备numpy、pandas数据处理课件.zip
- Fences 5是一款桌面整理软件,主要用于Windows操作系统,能够帮助用户更有效地管理和组织桌面上的图标和文件
- Appium入门 appium-desktop安装包,下载即可安装使用
- 初步图优化之后的fb bev 结构图
- 爬取cnnvd网站代码最新的 2024年
- 资源专区-毕业设计-数据分析-CRM客户关系管理系统
- 毕业设计-使用Matlab基于遗传算法+非线性规划实现的函数寻优算法-附项目源码.zip
- api接口python.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功