I've been searching about this topic for a few days now and I can't get a solution. I've looked at this topic too: StackOverflow How to push JGit
The problem is I'm doing a program that should be a github with only the very basic functions, but when I do a push commit messages works fine but if I change the content of some files it does not update on the remote repository.
I use this for commit:
Repository localRepo = new FileRepository(repository + "\\.git");
Git git = new Git(localRepo);
git.commit().setCommitter(txtCommiter.getText(),"").setMessage(txtCommit.getText()).call();
And I use this for pushing:
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();
Anyone can help my with this?