Work with libgit2sharp to retrieve only the latest revision of a specific branch
-
21-12-2019 - |
Question
Consider the following scenario: Some content (e.g. a web-site) is under git repository having several branches like master (for dev), qa and prod. A .net application (e.g. some cloud service) needs to have always the latest version of one specific branch (e.g. prod). There is no need to fetch full repository, only HEAD of this branch (git clone -b <branch> --depth=1 <remote_repo_url> --single-branch) and perform consequent updates.
How would you implement such scenario with libgit2sharp library?
Solution
Cloning only a truncated portion of the history from a repository (ie. shallow cloning) is not supported by LibGit2Sharp yet.
You can subscribe to issue #229 to be notified of future progress.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow