我已经查看了这篇文章中的答案(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)