c# - 使用 octokit 从分支检索内容
问题描述
我最近开始使用 octokit 库从 github 存储库中检索数据。
我可以形成一个搜索请求,例如
var request = new SearchCodeRequest("ValueSets", "xyzconnect", "projectA")
{
// we can restrict search to the file, path or search both
In = new[] { CodeInQualifier.Path },
};
var result = await client.Search.SearchCode(request);
或直接使用检索
var xsx1 = await client.Repository.Content.GetAllContents(repository.Id, "ValueSets");
当我使用默认分支(通常是主分支)时,这很好用,但是如何对其他分支执行相同的功能?
编辑
因此,要从分支获取内容,您可以使用 API
var xsx2 = await client.Repository.Content.GetAllContentsByRef(repository.Id, "ValueSets","develop");
解决方案
推荐阅读
- git - 如何让我的 Github 存储库反映我机器上的合并?
- webpack - 使用 Webpack 缓慢的 sass-loader 构建时间
- jquery - 即使浏览器最小化,如何运行我的 JS 脚本?
- sql - 具有两个不同表的 t/sql 查询
- node.js - 字段名与数据库中的列名不同
- rest - Moodle 网络服务刷新令牌
- user-interface - StreamBuilder 仅在 Flutter 中的流结束时更新
- r - 在 R data.table 中粘贴多列对的有效方法
- python - 如何在 Apache Beam 中动态跟踪状态?
- batch-file - 从文件读取和写入文件的cmd脚本丢失空行