简体   繁体   中英

how to commit to a special branch in a bare repository with libgit2?

I want implement a blog web app with history record feature based on Git. First, considering use git init --bare to save blog content.

But how could I do commit with a special branch?

I know, normally git shell command can't achieve commit operation to a bare repo if not checkout a branch to workspace.

Besides, github can edit and commit a file change to a specify branch if the repo is owned by yourself.

how about libgit2?

Thanks

With some struggle, I find libgit2 can create blob, tree and commit in buffer.

There are sample code in GitHub but not document well yet.Hope it will be some help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM