Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Open a repository over URL with JGIT(How can i open a git reposiroty available in a remote location???)
Open a repository over URL with JGIT [message #1225963] Tue, 31 December 2013 09:02 Go to next message
Vicknesh Subramaniyam is currently offline Vicknesh Subramaniyam
Messages: 4
Registered: December 2013
Junior Member
Hi all,

I have repository hosted in a remote location, and i would like to access / Open it and perform action via JGIT. Please note i don't want to clone it or use it as a remote repository.

Git git = Git.Open(new File("/repo"));

The above code will open the repository in the local file directory, i want a similer option to open up a repository through HTTP URL.

Is it possible??? if possible can anyone suggest the efficient way to do it.

Your help is much appreciated Very Happy
Re: Open a repository over URL with JGIT [message #1226081 is a reply to message #1225963] Tue, 31 December 2013 16:30 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 565
Registered: July 2009
Senior Member
Vicknesh,

what specific 'action' is it you want to do? In general, you cannot
directly modify a remote repository. This also isn't specific to JGit
but is the way Git works: clone a repository, create commits or
create/modify/delete branches/tags on the cloned repository, then push
those changes to the remote repository.

Depending on your use case, you might want to create a clone in a
temporary location, perform the desired 'actions' and then push the
changes back to the remote and delete the temporary local repository.

HTH
Rüdiger

On 31.12.2013 16:20, Vicknesh Subramaniyam wrote:
> Hi all,
> I have repository hosted in a remote location, and i would like to
> access / Open it and perform action via JGIT. Please note i don't want
> to clone it or use it as a remote repository.
>
> Git git = Git.Open(new File("/repo"));
>
> The above code will open the repository in the local file directory, i
> want a similer option to open up a repository through HTTP URL.
>
> Is it possible??? if possible can anyone suggest the efficient way to do
> it.
>
> Your help is much appreciated :d

--
Rüdiger Herrmann
http://codeaffine.com
Re: Open a repository over URL with JGIT [message #1226340 is a reply to message #1226081] Wed, 01 January 2014 12:41 Go to previous messageGo to next message
Vicknesh Subramaniyam is currently offline Vicknesh Subramaniyam
Messages: 4
Registered: December 2013
Junior Member
Rüdiger,

Thank you for your reply.

I don't want to do any modifications to the files in the GIT repository, but i want to get the log, commit history and the diffs, is it possible?

Thank you again.

Vicky

Re: Open a repository over URL with JGIT [message #1226353 is a reply to message #1226340] Wed, 01 January 2014 13:37 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 565
Registered: July 2009
Senior Member
Vicky,

I'd still recommend to clone the repository. It seems that you do not
need a working copy. If so you can configure the CloneCommand with
setNoCheckout( true ). This will speed up the clone operation since no
files are checkout out into the working directory.

HTH
Rüdiger

On 01.01.2014 13:41, Vicknesh Subramaniyam wrote:
> Rüdiger,
> Thank you for your reply.
>
> I don't want to do any modifications to the files in the GIT repository,
> but i want to get the log, commit history and the diffs, is it possible?
>
> Thank you again.
>
> Vicky
>
>
--
Rüdiger Herrmann
http://codeaffine.com
Re: Open a repository over URL with JGIT [message #1226366 is a reply to message #1226340] Wed, 01 January 2014 14:30 Go to previous messageGo to next message
R Shapiro is currently offline R Shapiro
Messages: 386
Registered: June 2011
Senior Member
Quote:
I don't want to do any modifications to the files in the GIT repository, but i want to get the log, commit history and the diffs, is it possible?


How would you do this with command-line Git? As far as I know you can't; these operations can only be done on a repository that's accessible as a file path. So it's not surprising that JGit behaves the same way.

Unless you can set up a file share, or launch the JGit process remotely on the host where the repository lives, I think your only option is to use a clone.

Re: Open a repository over URL with JGIT [message #1226589 is a reply to message #1226353] Thu, 02 January 2014 06:18 Go to previous messageGo to next message
Vicknesh Subramaniyam is currently offline Vicknesh Subramaniyam
Messages: 4
Registered: December 2013
Junior Member
Rüdiger,

Thank you very much for your reply.


Rüdiger Herrmann wrote on Wed, 01 January 2014 08:37

It seems that you do not
need a working copy. If so you can configure the CloneCommand with
setNoCheckout( true ). This will speed up the clone operation since no
files are checkout out into the working directory.


This is a very useful information because i was worried about the unwanted data load created by cloning the entire repository, in this way i can reduce it.

Thank you again.

Re: Open a repository over URL with JGIT [message #1226590 is a reply to message #1226366] Thu, 02 January 2014 06:20 Go to previous message
Vicknesh Subramaniyam is currently offline Vicknesh Subramaniyam
Messages: 4
Registered: December 2013
Junior Member
Shapiro,

Thank you for your reply.
Previous Topic:Compare With/Replace With bug in nightly build?
Next Topic:TranslationBundleLoadingException
Goto Forum:
  


Current Time: Sat Oct 25 14:49:25 GMT 2014

Powered by FUDForum. Page generated in 0.01770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software