0
我一直在尋找這個主題幾天了,我無法獲得解決方案。我也看過這個話題:StackOverflow How to push JGitJGit推送不會更新文件
問題是我正在做一個程序,應該是一個github只有非常基本的功能,但是當我做推送提交消息工作正常,但如果我改變它不在遠程存儲庫上更新的某些文件的內容。
我用這個承諾:
Repository localRepo = new FileRepository(repository + "\\.git");
Git git = new Git(localRepo);
git.commit().setCommitter(txtCommiter.getText(),"").setMessage(txtCommit.getText()).call();
而且我用這個推:
Repository localRepo = new FileRepository(this.repository + "\\.git");
Git git = new Git(localRepo);
PushCommand push = git.push();
UsernamePasswordCredentialsProvider user = new UsernamePasswordCredentialsProvider(this.userName, this.pwd);
push.setCredentialsProvider(user);
push.setRemote(this.remote);
push.call();
任何人都可以幫我這個?
謝謝robinst,問題是對提交缺少setAll()方法。 – Taka