What is the advantage of using a Git object database?

In a discussion of the comments on this issue, libgit2sharp highlighted that I can create commits against an object database?

What happens to the object database?

Why is it profitable to do regular git add and git commit?

I am trying to import a commit history from another SourceGear source control system into Git. At the moment, my logic is simply sorting through files in another version control system, getting a specific version and information about fixing it repo.Index.Stage, and then doing it repo.Commit. I assume this is correct, should I use an object database?

+3
source share
1 answer

LibGit2Sharp , , :

using (var repo = new Repository("path/to/a/repository"))
{
    // do stuff

    repo.Index.Stage("path/to/file1");
    repo.Index.Stage("path/to/file2");

    repo.Commit("This is my commit", ....);

    // more stuff
}

- : .

Stage() . Commit() index .

v0.9, LibGit2Sharp Commits Stage(). , .

Commits, API ObjectDatabase, Blobs Trees. ObjectDatabaseFixture.

obect?

Commit , . API , .

git add git commit?

... . ;-) :

  • Blobs / Commit
  • working directory -> index -> odb, . API, Blobs Trees , , Commit.
  • API , Commit,
  • Git - - , . API , .

, repo.Index.Stage, repo.Commit. , , ?

, , .

+4

All Articles