|Re: [jgit-dev] Issue in Using JGit PullCommand|
2012/11/15 Isuru Haththotuwa <isurulucky@xxxxxxxxx>
have a look at jgit's PullCommandTest  or egit's PullOperation  which is using PullCommand.Hi All,
I'm trying to use jgit PullCommand to get the functionality equal to svn update. When I use CloneCommand, a clone of the remote repository is made in the local host. However, when I use the PullCommand, I noticed that the changes in the remote repository are not merged in to the local repository. Is there a proper java sample which shows how to use this command? I could not find such a sample in the jgit documentation as well. I have included the code sample that I used below:
I use this code after the initial cloning, but any additional files added after the initial clone are not updated in the local repository. Please let me know what is the issue here.
You should check the result returned by the command in order to get more details aboutwhat's going on. From the PullResult you can obtain the FetchResult which should explainif you got anything new from the other repository. If the receiving repository has no HEAD oris in detached HEAD state an exception is thrown. If the current branch in the receiving repositorydoesn't track a branch of the upstream repository the current branch will not be changed (seegit branch -- track in ).