[SOLVED][JGit] issue use "pull" [message #1064607] |
Thu, 20 June 2013 08:26 |
|
Hello everyone,
I am looking to do methods that use APIs and libs JGit (org.eclipse.jgit).
I want to do a "pull" in my first method, but it does not see the new revisions on the bare.
Here's the code:
public class GitService {
public static void gitsynchro() throws IOException, GitAPIException {
Repository depotLocal;
Repository depotDistant;
depotLocal = new FileRepository("/home/***/***/***/projet/.git");
depotDistant = new FileRepository("/home/***/***/gitserver");
Git git = new Git(depotLocal);
Git git2 = new Git(depotDistant);
System.out.println(depotDistant);
System.out.println("===== distant =====");
for (RevCommit log : git2.log().call()) {
System.out.println(log.getFullMessage());
}
System.out.println("===== local =====");
System.out.println(depotLocal);
for (RevCommit r : git.log().call()) {
System.out.println(r.getFullMessage());
}
String pull;
pull = git.pull().call().toString();
System.out.println("pull : {" + pull + "}");
for (RevCommit r2 : git.log().call()) {
System.out.println(r2.getFullMessage());
}
}
}
Sorry for my English I'm French.
[Updated on: Mon, 08 July 2013 08:32] Report message to a moderator
|
|
|
Re: [JGit] issue use "pull" [message #1064657 is a reply to message #1064607] |
Thu, 20 June 2013 12:55 |
|
And the result of the "pull" looks like this :
pull : {org.eclipse.jgit.transport.FetchResult@12413ffc
Merge of revisions fd0717e2e7a3f71774f789c8876da9c2e14a535e, fd0717e2e7a3f71774f789c8876da9c2e14a535e with base fd0717e2e7a3f71774f789c8876da9c2e14a535e using strategy resolve resulted in: Already-up-to-date. }
Sorry for my English I'm French.
[Updated on: Thu, 20 June 2013 13:00] Report message to a moderator
|
|
|
|
Re: [JGit] issue use "pull" [message #1064694 is a reply to message #1064683] |
Thu, 20 June 2013 14:57 |
|
result of "git config -l --local" on local repository :
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=/home/itldev/cochise/gitcochiseclient/../gitserver/
branch.master.remote=origin
branch.master.merge=refs/heads/master
result of " git show-ref" on local repository :
9ec1d595f7b3d3559cafabe59bad2bb3b89247ee refs/heads/master
fd0717e2e7a3f71774f789c8876da9c2e14a535e refs/remotes/origin/HEAD
fd0717e2e7a3f71774f789c8876da9c2e14a535e refs/remotes/origin/master
900a7ba7a233765eb6d571e9adf895760eb1462a refs/tags/v1.0
NB : I did a "git pull" manually before your message
And now from the bare (if you need it).
git config -l --local
core.repositoryformatversion=0
core.filemode=true
core.logallrefupdates=true
git show-ref
62ba46cc14be4d7afcf08ffbac96b681a5dd27b3 refs/heads/master
Sorry for my English I'm French.
|
|
|
Re: [JGit] issue use "pull" [message #1064696 is a reply to message #1064694] |
Thu, 20 June 2013 15:00 |
|
now the pull message looks like this :
pull : {org.eclipse.jgit.transport.FetchResult@2870068a
Merge of revisions 9ec1d595f7b3d3559cafabe59bad2bb3b89247ee, fd0717e2e7a3f71774f789c8876da9c2e14a535e with base fd0717e2e7a3f71774f789c8876da9c2e14a535e using strategy resolve resulted in: Already-up-to-date. }
Sorry for my English I'm French.
|
|
|
|
Re: [JGit] issue use "pull" [message #1064705 is a reply to message #1064701] |
Thu, 20 June 2013 15:15 |
|
this is in my last reply, but I do it again and no change.
pull : {org.eclipse.jgit.transport.FetchResult@704666b6
Merge of revisions 9ec1d595f7b3d3559cafabe59bad2bb3b89247ee, fd0717e2e7a3f71774f789c8876da9c2e14a535e with base fd0717e2e7a3f71774f789c8876da9c2e14a535e using strategy resolve resulted in: Already-up-to-date. }
Sorry for my English I'm French.
|
|
|
|
Re: [JGit] issue use "pull" [message #1064812 is a reply to message #1064718] |
Fri, 21 June 2013 08:23 |
|
Hello Christian and thank you for your help, I found a solution with another engineer on my team.
The problem was this line of code:
depotDistant = new FileRepository("/home/itldev/cochise/gitserver/[u].git[/u]");
That changed the bare in another repository.
I clean it, reset it and now it's ok.
Thank you and goodbye
Sorry for my English I'm French.
|
|
|
Powered by
FUDForum. Page generated in 0.06744 seconds