Foren

Switching git branches in eclipse leaves portlets laying around?

thumbnail
Cameron McBride, geändert vor 12 Jahren.

Switching git branches in eclipse leaves portlets laying around?

Expert Beiträge: 269 Beitrittsdatum: 08.02.11 Neueste Beiträge
I am new to git so I may be missing some critical detail.

1. Be in the local master branch but also have a local branch "test" created off master
2. In my eclipse I have the entire plugins-sdk imported and under git control
3. Create a new portlet in the plugins-sdk
4. Immediatly add+commit your changes
5. Switch to test
6. See in eclipse that your portlet folder is still there except has a ? on the icon (in master it has the source control icon)
7. Now you have a rogue folder in your test branch that shouldn't be there. It will be there forever unless you delete it.
8. Now create a new portlet in your test branch
9. Immediatly add+commit it
10. Switch back to the master branch
11. Now you have the rogue portlet from your test branch in master. It has the ? icon by it.

I am about to install msysgit and tortoisegit and see if they behave the same way. I am on Eclispe Indigo, which includes EGit with it.
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: Switching git branches in eclipse leaves portlets laying around?

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
If you switch branches everything that is not under version control will remain.
So if you compiled you your portlet there will be compiled classes, that you have not checked in. so if you switch branches the folder wont be removed. (though the source files wont be there since these *are* versioned)

You can run git clean -fd to get rid of everything not under version control