How do I clone git repo using plugin code.
Answered
Hi,
I'm trying to develop a plugin where source code of a component of project can be automatically cloned and added as a separate module and a dependency to the core module.
I have gone through the below link but found nothing useful to allow me clone the repository.
https://www.jetbrains.org/intellij/sdk/docs/reference_guide/vcs_integration_for_plugins.html
More precisely, how do I perform this operation
GitCheckoutProvider.clone(project, Git.getInstance(), listener, destinationParent, sourceRepositoryURL, directoryName, parentDirectory)
Thanks in Advance.
Please sign in to leave a comment.
The method that you refer to is a static method that you can call from everywhere.
You also have to make sure, that in your Gradle configuration, you've added a dependency to the git4idea plugin:
Can you provide me with any document on how to use Git API ? As I'm looking not to handle user credentials for my plugin separately.
Git plugin sources are available in JetBrains GitHub repository: https://github.com/JetBrains/intellij-community/tree/master/plugins/git4idea/src/git4idea
Probably you'll be interested in GitHttpGuiAuthenticator class, however, you should check the sources first which have JavaDocs describing most of the plugin functionalities.
I am still getting this same error as before
this is how my gradle file looks like
Do you have a Git4Idea plugin dependency set in plugin.xml?
Yeah I had missed that.
I'm having difficulties finding the right class to clone a repository that is authenticated.
`GitHttpGuiAuthenticator` is of no help.
Basically I want this clone method to automatically ask for username and password if required, store it safely and not ask again if the stored pass still works.