Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# - Find git repository programmatically - source code requested

Posted on 2016-08-10
3
Medium Priority
?
569 Views
Last Modified: 2016-08-18
In a C# windows form application, if I want to scan my entire hard drive and locate all of the git repositories that were created using "git clone [path_to_repository]".  Of course I know where they all are already - I want to find the same repos programmatically. -- how would this best be done?

When a "git clone ..." command is run, are there always certain files created?  Tell-tale ways to know a folder is a repo?

Is the presence of a hidden ".git" folder enough to pretty much a "guarantee" that I am inside a repository?

Please provide working C# source code.
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 2000 total points
ID: 41751045
I suggest looking at github

https://github.com/manojlds/cmd

The API/SDK may have the source code you need :)
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 41751127
An interesting share, but I still want to accomplish the above FIRST - then perhaps use the library to run git commands SECOND.
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 41761160
Well, no other takers, so you get the points, my friend.

My final solution was to not try and find the .git folders.  It took such a long time to search the entire drive that it was not worth attempting a brute force approach.  So I just have the user provide the git directory herself.

I will still consider your advice and will pursue it more if I think I need to.

Tom
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
How to create a branch, fetch changes, and merge them into another branch using the EGit plugin for Eclipse.
How to commit changes, push them to a remote repository, and pull them from another location using the EGit plugin for Eclipse.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question