Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decoding Git index file using C#

Tags:

git

c#

low-level

Is there any documentation about internal structure of Git index file? From various book I know it's binary and it contains SHAs of staged files, I know about Git 'plumbing' commands helping to reveal index content...

But how about read index by myself using C#, for example?

I know that there several implementations of this feature, so it's possible to study the code:

  • In Git itself;
  • In libgit2 written on C;
  • In GitSharp ported to C# from Java.

And all these options a bit complex, because need to hack around other's code. I would prefer to develop from scratch using data format explanation. If it's possible of cause.

Would appreciate your help very much!

like image 952
shytikov Avatar asked Jan 18 '23 03:01

shytikov


1 Answers

Take a look at Documentation/technical/index-format.txt in the git.git repository:

http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/technical/index-format.txt;hb=HEAD

like image 139
Richard Hansen Avatar answered Jan 22 '23 11:01

Richard Hansen