1
プログラムを以前のバージョンにダウングレードしたいと考えています。それはlibgit2で可能ですか?HEADをlibgit2の指定された参照またはタグにチェックアウトする方法は?
私のコード
string path = "C://Local//Path//to//my//repo";
string tag = "refs/tags/v0.0.4";
git_libgit2_init();
const char * REPO_PATH = path.c_str();
git_repository * repo = nullptr;
git_repository_open(&repo, REPO_PATH);
git_reference *ref;
git_reference_lookup(&ref, repo, "refs/heads/master");
git_reference *new_ref;
git_reference_symbolic_set_target(&new_ref, ref,tag.c_str(),"message");
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
// how to specify options to use ref or tag?
git_checkout_head(repo, &opts);
git_repository_free(repo);
git_libgit2_shutdown();
を得た私は、この http://stackoverflow.com/questions/43342676/how-to-に接続されている別の問題があると思います指定されたバージョンを使用するlibgit2に切り替える –