libgit2.example

Modules

add
module libgit2.example.add

The following example demonstrates how to add files with libgit2.

args
module libgit2.example.args

Argument-processing helper structure

blame
module libgit2.example.blame

This example demonstrates how to invoke the libgit2 blame API to roughly simulate the output of git blame and a few of its command line arguments.

cat_file
module libgit2.example.cat_file
checkout
module libgit2.example.checkout

The following example demonstrates how to do checkouts with libgit2.

clone
module libgit2.example.clone
Undocumented in source.
commit
module libgit2.example.commit

This example demonstrates the libgit2 commit APIs to roughly simulate git commit with the commit message argument.

common
module libgit2.example.common
config
module libgit2.example.config
describe
module libgit2.example.describe

The following example partially reimplements the git describe command and some of its options.

diff
module libgit2.example.diff

This example demonstrates the use of the libgit2 diff APIs to create libgit2.diff.git_diff objects and display them, emulating a number of core Git diff command line options.

fetch
module libgit2.example.fetch
Undocumented in source.
for_each_ref
module libgit2.example.for_each_ref
Undocumented in source.
general
module libgit2.example.general

[**libgit2**]lg is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.

index_pack
module libgit2.example.index_pack
Undocumented in source.
init
module libgit2.example.init

This is a sample program that is similar to "git init". See the documentation for that (try "git help init") to understand what this program is emulating.

lg2
module libgit2.example.lg2

This part is not strictly libgit2-dependent, but you can use this as a starting point for a git-like tool

log
module libgit2.example.log

This example demonstrates the libgit2 rev walker APIs to roughly simulate the output of git log and a few of command line arguments. git log has many many options and this only shows a few of them.

ls_files
module libgit2.example.ls_files

This example demonstrates the libgit2 index APIs to roughly simulate the output of git ls-files. git ls-files has many options and this currently does not show them.

ls_remote
module libgit2.example.ls_remote
Undocumented in source.
merge
module libgit2.example.merge

The following example demonstrates how to do merges with libgit2.

push
module libgit2.example.push

This example demonstrates the libgit2 push API to roughly simulate git push.

remote
module libgit2.example.remote

This is a sample program that is similar to "git remote". See the documentation for that (try "git help remote") to understand what this program is emulating.

rev_list
module libgit2.example.rev_list
rev_parse
module libgit2.example.rev_parse
show_index
module libgit2.example.show_index
stash
module libgit2.example.stash
status
module libgit2.example.status

This example demonstrates the use of the libgit2 status APIs, particularly the libgit2.types.git_status_list object, to roughly simulate the output of running git status. It serves as a simple example of using those APIs to get basic status information.

tag
module libgit2.example.tag

The following example partially reimplements the git tag command and some of its options.