Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » how to remove folder from git version control
how to remove folder from git version control [message #1404582] Mon, 04 August 2014 09:50 Go to next message
ken wong is currently offline ken wongFriend
Messages: 4
Registered: August 2014
Junior Member
This is a classical problem - I cannot find a obvious solution. Although it happens twice a week or so...

Scenario
Somebody commits and pushed a folder or file that should not be under version control: e.g. /target
Question
How to remove this folder from git version control, With EGit? I have tried to right click the target folder and deleted it, but it will automatically create again. how can i fix this problem?
Re: how to remove folder from git version control [message #1404663 is a reply to message #1404582] Mon, 04 August 2014 19:15 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
ken wong skrev 2014-08-04 15.49:
> This is a classical problem - I cannot find a obvious solution. Although it happens twice a week or so...
> Scenario
> Somebody commits and pushed a folder or file that should not be under version control: e.g. /target Question
> How to remove this folder from git version control, With EGit? I have tried to right click the target folder and deleted it, but it will automatically create again. how can
> i fix this problem?

It seems Eclipse creates the folder. You just don't want to track it, so you can remove all files and commit the change. Eclipse
will still create the folder, but the files will be outside of version control.

-- robin
Re: how to remove folder from git version control [message #1404677 is a reply to message #1404663] Tue, 05 August 2014 01:17 Go to previous messageGo to next message
ken wong is currently offline ken wongFriend
Messages: 4
Registered: August 2014
Junior Member
hi,robin,this is a maven project.
although i remove the target folder and commit,
but when i build the project,the files will be created again.
and when i commit,the commit dialog box will show all the files which are in the target folder.

[Updated on: Tue, 05 August 2014 01:18]

Report message to a moderator

Re: how to remove folder from git version control [message #1404696 is a reply to message #1404677] Tue, 05 August 2014 07:16 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Add the target folder to .gitignore and commit the .gitignore so that all developers have it.
Note that you can't ignore files which are already tracked in version history. If that happened
you can stop versioning files by using "Team > Advanced > Untrack" and commit this change
using the staging view (doesn't work with commit dialog since it ignores the index).
Re: how to remove folder from git version control [message #1404839 is a reply to message #1404696] Wed, 06 August 2014 01:38 Go to previous messageGo to next message
ken wong is currently offline ken wongFriend
Messages: 4
Registered: August 2014
Junior Member
thank you for your reply.
but i still can not figure it out.
i've try your solution。but when i switch to another branch.
eclipse still tell me i have uncommited changes which located at the target folder.
they are two property files(pom.properties),but in the staging view,nothing shows in Staged Changes.
Re: how to remove folder from git version control [message #1420095 is a reply to message #1404839] Tue, 09 September 2014 13:36 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
cherry-pick the commit with the .gitignore changes to the branches where you want to also ignore these files ?
Previous Topic:Problems with egit.github
Next Topic:Multi repositories project
Goto Forum:
  


Current Time: Fri Mar 29 14:49:11 GMT 2024

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

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

Back to the top