如何从目标c中的GIT存储库中获取文件?

时间:2023-01-13 21:47:42

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?

所以我在GIT存储库中有文件存储。现在我通常做一个git pull来获得最新版本。由于我希望得到的文件路径基本上是一个URL:https://github.com/.../myfile.extention,有没有办法在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?

我知道如何使用NSURL和NSURLRequest从URL获取数据,但我不确定以下内容:1。获取?还是POST? 2.我如何进行身份验证?

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?

我在Google上搜索过,但主要得到的结果却给了我某种框架效果。如果没有一些额外的框架,有没有办法以最简单的方式做到这一点?

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

更新:下面的一些建议我使用Git.Framework,但它们还不支持远程推送和拉动,如下所示。

如何从目标c中的GIT存储库中获取文件?

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

有没有人知道如何从目标c代码中提取和推送文件?

1 个解决方案

#1


1  

Try Git.framework. It seems to be a proper tool for this task. From their website:

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

The currently supported features of the project are

目前支持的项目功能是

  • Reading objects, both loose and packed
  • 阅读物品,包括松散和包装
  • Resolving refs from .git/refs
  • 解析.git / refs中的引用
  • Reading branches, both local and remote
  • 阅读本地和远程的分支机构
  • Enumeration of commits in breadth and depth first orders
  • 枚举广度和深度优先订单
  • Rev-list Support to a certain degree, full compatibility with git rev-list is not yet available
  • Rev-list在某种程度上支持,与git rev-list完全兼容尚不可用
  • Preliminary PACK File and Index generation support (API needs work, deltas currently unsupported)
  • 初步的PACK文件和索引生成支持(API需要工作,当前不支持的增量)

#1


1  

Try Git.framework. It seems to be a proper tool for this task. From their website:

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

The currently supported features of the project are

目前支持的项目功能是

  • Reading objects, both loose and packed
  • 阅读物品,包括松散和包装
  • Resolving refs from .git/refs
  • 解析.git / refs中的引用
  • Reading branches, both local and remote
  • 阅读本地和远程的分支机构
  • Enumeration of commits in breadth and depth first orders
  • 枚举广度和深度优先订单
  • Rev-list Support to a certain degree, full compatibility with git rev-list is not yet available
  • Rev-list在某种程度上支持,与git rev-list完全兼容尚不可用
  • Preliminary PACK File and Index generation support (API needs work, deltas currently unsupported)
  • 初步的PACK文件和索引生成支持(API需要工作,当前不支持的增量)