I'm a little confused about how to get started with PyGit2.
When adding files (plural) to a newly created repo, should I add them to
index.add('path/to/file')
or would I be better off creating a TreeBuilder and using
tb.insert( 'name',oid, GIT_FILEMODE_BLOB )
to add new content ?
If the second case, I am stumped as to how I create the tree object needed to commit to a newly created repo?
Anyone?
Assuming your
pygit2.Repository
is calledrepo
, try:More handy info with
help(pygit2.TreeBuilder)
from Python console.