Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Howto avoid subfolder with remote push
Howto avoid subfolder with remote push [message #1789997] Fri, 01 June 2018 16:38 Go to next message
Eclipse UserFriend
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 19:40 Go to previous messageGo to next message
Eclipse UserFriend
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 02:15 Go to previous message
Eclipse UserFriend
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 Jul 15 22:46:31 EDT 2025

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

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

Back to the top