Is there a way to commit part of modified files (all files are staged) by using libgit2sharp?

StackOverflow https://stackoverflow.com/questions/17742362

  •  03-06-2022
  •  | 
  •  

문제

Is there a way to commit part of modified files (all files are staged) by using libgit2sharp?

There are no Commit method in Repository that takes path parameter.

도움이 되었습니까?

해결책

Is there a way to commit part of modified files (all files are staged) by using libgit2sharp?

Currently, there's no way to perform a partial staging/unstaging in LibGit2Sharp. I'd suggest you to subscribe to Issue 195 in order to be notified when this is available.

There are no Commit method in Repository that takes path parameter.

Actually, the action of committing consists of taking a snapshot of the Index and creating a durable Commit git object in the object database. As such, the Commit API doesn't accept paths.

In order to create a Commit from a file (or list of files) on your file system, you'd first have to add them to the Index with repo.Index.Stage(), then invoke the repo.Commit() method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top