Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Howto avoid subfolder with remote push
Howto avoid subfolder with remote push [message #1789997] Fri, 01 June 2018 20:38 Go to next message
Matthias Albert is currently offline Matthias AlbertFriend
Messages: 6
Registered: September 2010
Junior Member
This might be a newby question:

My web hosting provider offers git push/pull access from my local computer. This works generally fine using EGit from Eclipse.

However, in the server destination folder, a subfolder is being created with the same name as my local project folder.

Is there a way to avoid this subfolder by configuration of the remote/local mapping? I would like to push the files contained in my Eclipse project to the server destination without a subfolder.

Thanks in advance.

Matthias
Re: Howto avoid subfolder with remote push [message #1789998 is a reply to message #1789997] Fri, 01 June 2018 23:40 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1032
Registered: July 2009
Senior Member
What is the server destination folder ?
Can you provide steps to reproduce ?
Re: Howto avoid subfolder with remote push [message #1790102 is a reply to message #1789997] Tue, 05 June 2018 06:15 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 80
Registered: August 2016
Member
If by remote/local mapping you mean the push refspec: no, that cannot be used for this.

Examine the working tree of your git repository (in EGit's "Git Repositories" view, or on disk). I bet you'll find that you have something like
.git/
myWebsite/
myWebsite/.project
myWebsite/index.html

and on the server things end up not at www.provider.com/user/index.html but at www.provider.com/user/myWebsite/index.html.

So just get rid of that local "myWebsite" folder:

1. Delete the myWebsite project in Eclipse (don't delete it on disk).
2. On disk, move all files up one level and delete the then empty myWebsite folder:
.git/
.project
index.html

3. Refresh the "Git Repositories" view
4. Choose "Imports projects..." in the context menu of the repository in the "Git Repositories" view
5. Commit
6. Push
Previous Topic:JGit PUSH only Single File
Next Topic:manyrepos and eGit :: vs many remotes
Goto Forum:
  


Current Time: Tue Sep 25 15:19:15 GMT 2018

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

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

Back to the top