I understand the concept of Git fetch. I would like to fetch objects through the FetchCommand class in the JGit API.
I have a Git repository. For example C:\jGit\.git
.
I have cloned this repository. For example: C:\jGitClone\jGit\.git
.
I have cloned this repository again. For example C:\Users\user\Desktop\jGitClone\.git
.
Using the JGit API I have a Git class:
Git git = new Git(repository); // this is the cloned repository. C:\jGitClone\jGit\.git
How would I set the cloned repository which is on the desktop so when the fetch is called it knows to fetch into the this repository.
I have looked on some websites including the 1 below but still stuck.
Git fetch failing using jgit: Remote does not have <branchname> available for fetch