[英]C# How to check if git repository was updated
I would like to do a C# program that checks every x times if an online git repository (let's say a specific subdirectory) was updated and if so, download it to a specific folder. 我想做一个C#程序,它每隔x次检查一次在线git信息库(例如特定的子目录)是否已更新,如果已更新,请将其下载到特定的文件夹中。 The thing is that I don't even know how to do the first step. 问题是我什至不知道如何做第一步。 I looked up the internet and I found a library called libgit2sharp. 我上网查询,发现一个名为libgit2sharp的库。 I don't know git very well but I saw that I can get the sha string of a commit with libgit2sharp so maybe that could help. 我不太了解git,但是我发现我可以使用libgit2sharp获取提交的sha字符串,因此也许可以帮上忙。 Any idea? 任何想法?
Thanks in advance 提前致谢
Use the git 'fetch' command to check for new commits. 使用git'fetch'命令检查新提交。
You can also use gitbash and parse the result it is quite simple. 您还可以使用gitbash解析结果,这非常简单。
see http://git-scm.com/docs/git-fetch 参见http://git-scm.com/docs/git-fetch
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.