Java (Egit 및 Jgit Api)에서 Git Api를 사용하여 Git 저장소에서 새로 추가, 삭제 및 수정 된 파일을 추적하고 싶습니다. 어떻게해야합니까 ??
많은 예제를 찾기 위해 JGit 단위 테스트 를 살펴볼 수 있습니다 .
그것은 포함 org.eclipse.jgit.api.StatusCommandTest
Git git = new Git(db);
writeTrashFile("a", "content of a");
writeTrashFile("b", "content of b");
writeTrashFile("c", "content of c");
git.add().addFilepattern("a").addFilepattern("b").call();
Status stat = git.status().call(); // git status right there
assertEquals(set("a", "b"), stat.getAdded());
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다