小编Ant*_*ony的帖子

使用 libgit2 进行 Git Pull

我已经查看了这篇文章中的答案(libgit2 (fetch & merge & commit)),但我正在努力让 Git Pull 工作。我没有收到错误消息。Fetch 似乎可以工作,但没有发生 Merge。做一个 Git 状态显示我的分支落后于 1 个提交......

On branch Branch_1_1.
Your branch is behind 'origin/Branch_1_1' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

我的代码在下面...

static int fetchhead_ref_cb(const char *name, const char *url,
   const git_oid *oid, unsigned int is_merge, void *payload)

{
   if ( is_merge )
   {
      strcpy_s( branchToMerge, 100, name );
      memcpy( &branchOidToMerge, oid, sizeof( git_oid ) …
Run Code Online (Sandbox Code Playgroud)

c++ git libgit2

6
推荐指数
1
解决办法
2060
查看次数

标签 统计

c++ ×1

git ×1

libgit2 ×1