Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Switching Branches after Refactoring(Can't switch branches because it's complaining about uncommitted changes.)
Switching Branches after Refactoring [message #1819043] Mon, 06 January 2020 08:11 Go to next message
Mik Clarke is currently offline Mik ClarkeFriend
Messages: 1
Registered: January 2020
Junior Member
I wanted to do some fairly major refactoring for a project, so I created a new branch and used a combination or Refactor, drag drop and copy/paste to restructure my packages so things were how I wanted them. Rework the build to use a pure ant build as well, produce a number of extra build artifacts int he process.

All worked well.

Then I switched back to my original branch to do some work with the older version of the code. As a minor issue, I noted that my new build artificats were still present - and clean didn't seem to get rid of them.

The real problem comes when I try and switch back to be refactored branch. I keep getting a dialog saying that there are uncommitted changes (there aren't any). Selecting 'discard changes' just brings the dialog back up. Selecting cancel just cancels the switch.

How do I get back to my new branch?

I did find something in the forums that suggested deleting the refactored files - but they are supposed to be in the branch I'm in at the moment - and they have been moved and renamed in the refactored branch I can't get into.

Any ideas?
Re: Switching Branches after Refactoring [message #1819185 is a reply to message #1819043] Thu, 09 January 2020 16:16 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
Which version do you use ?

EGit only keeps track of versioned files when you switch to another branch.

Try to run git clean -xffd from the command line to remove all non-versioned files.
Can also be run from EGit in repositories view.
Previous Topic:Failing to upload repo to github using eclipse 201912 -SSL protocol_version
Next Topic:Can you and how to connect to azure devops git supported?
Goto Forum:

Current Time: Thu Sep 29 06:04:51 GMT 2022

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

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

Back to the top