Keith
Keith

Reputation: 797

managing a git repo via a .NET executable

This question was helpful, but not complete, looking for more to this:

we have production code that we need end-users (not developers) to use at various versions and (long story), this is tracked as different commits in git. the git repo is on the local machine and we (devs) make sure it's pulled for each deployment. Right now, they use various shortcuts to .bat files which checkout the commit they need for a certain type of work. It's a long story I don't have room here to describe why this is the usage, but it works, let's not quibble over it.

we want to replace the shortcuts to bat files with shortcuts to an exe so it's compiled. we'll use a config file to determine which type of work is which commit. What I need: send git commands (status/checkout) to the command line (or to git directly? do they have an api?) and get the (string) results so I can ensure the checkout worked. Thoughts?

Upvotes: 0

Views: 145

Answers (1)

Philippe
Philippe

Reputation: 31147

You have 2 solutions...

  1. Call the git exe file and parse the text results. And indeed, it could be painful. And git must be installed on each computer

  2. You could use https://github.com/libgit2/libgit2sharp that is a perfectly fine library to do that and maintained by guys of github and Microsoft

Upvotes: 1

Related Questions