6
我有a relatively short Gist,它應該使用libgit2
來模擬git pull
命令的功能。不幸的是,它不是很有效。用libgit2實現'git pull'?
綜上所述,片段:
- 電話
git_repository_open()
打開磁盤上的存儲庫 - 電話
git_remote_load()
獲得git_remote *
遠程命名爲「原點」 - 電話
git_remote_connect()
與GIT_DIRECTION_FETCH
標誌 - 調用
git_remote_download()
從遠程獲取對象
根據git_remote_stats()
,確實正在提取對象。但工作目錄不會更改以反映最新的提交。我試圖加入:
git_checkout_head(repo, NULL);
......但這沒有什麼區別。
請輸入:
git checkout master
...在下面的輸出端子結果:
Already on 'master' Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
我怎麼快進?
其實,有含'git_merge'功能的WIP(工作正在進行中)分公司。它似乎相對成熟,我目前正在考慮使用它。 – 2013-03-19 18:01:05
沒關係。我認爲分支需要重新分配。 – 2013-03-24 06:53:03
什麼新東西? – 2013-11-25 18:47:39