1

So I have files stores in a GIT repository. Now I usually do a git pull to get the latest revisions. Since the path to the file I wish to get is basically a URL like: https://github.com/.../myfile.extention, is there a way I can get the file in Objective C?

I know how to get data from a url using NSURL and NSURLRequest, but i'm not sure of the following: 1. GET ? or POST? 2. How do i authenticate?

I've searched on Google but gotten mostly results that give me some sort of frame work. Is there any way to do this in the simplest way without some extra framework?

Update: Some below have suggested I use the Git.Framework, but they do not as yet support remote pushing and pulling as seen below.

enter image description here

Does any one know how to pull and push a file from objective c code?

4

1 回答 1

1

试试Git.framework。它似乎是完成这项任务的合适工具。从他们的网站:

该项目目前支持的功能是

  • 阅读散装和包装的物品
  • 从 .git/refs 解析 refs
  • 读取本地和远程分支
  • 以广度和深度为首的提交枚举
  • rev-list 一定程度的支持,目前还没有完全兼容 git rev-list
  • 初步 PACK 文件和索引生成支持(API 需要工作,当前不支持增量)
于 2012-08-30T20:58:52.903 回答