Eclipse Subversive plugin: Why can't I create this branch? - eclipse

I recently switched from Subclipse to Subversive for SVN integration in Eclipse, and I'm having trouble creating a branch of my source code.
I've tried a few different variations of my method, but they all led me to the same roadblock. Basically, here's what I'm trying to do.
Navigator pane
Right-click on project folder (want to branch the whole thing)
Team > Branch
In the Location field, browse to select the /branches folder in my repository
Add the branch name to the path field, i.e. "/testbranch" (not pictured)
The dialog then looks like this, and I can't continue.
http://img820.imageshack.us/img820/1011/branchingfail.png
What am I doing wrong here? Why can't I create this branch? If nothing else, can it at least be confirmed that I'm following the right process, and it's something about my environment or configuration that's stopping the branch from being created?

I found that SVN is very particular with the SVN connectors. If you connected and downloaded SVN code with one connector and then switched to a different connector when you started using Subversive, you'll definitely have problems.
I've had unexplained Subversive problems in the past and they've almost always tracked back to different connector usage. The solution for me was to reset all of my local SVN code. I deleted everything local and rechecked out all of my code. Everything appeared to be fine after that.
I hope this helps.

I don't consider this a proper solution, but it's at least got me working again. Instead of running a branch operation, I created a new folder inside my branches folder, and then copied the contents of the trunk folder into it. I was then able to switch to my new "branch".

Make sure you do not have any uncommited changes, and then do a Team>cleanup. Also make sure you are branching from the trunk and that you do not have any mixed version. For example you can have a folder below the root be from another branch while the rest of the project is from trunk. This will cause the branch creation to fail. When having issues with branches from the navigator, try reverting the project (right click choose team>revert) several times. Then execute the cleanup several times.
Also you may consider creating the branch from the SVN Repositories view. From this view right click on the location you want to branch from (ie truck) and select New>branch from the context menu. One last step is from the navigator view you will need to swtich your project to the newly created brancn: right click on the project root and select Team>switch from the context menu

Related

How do I get back my files marked as deleted in the unstaged changes area of Git staging?

I'm running Eclipse Kepler Service Release 1 with egit for versioning. I've been using eclipse and egit for just a few months and am not up on all of it's intricacies yet. I've found some related questions here for git, but I don't really understand how to use egit to accomplish what the answers propose.
The immediate problem I have is that no files are visible in the project tree except for the libraries and WEB-INF under war. The files show up in the unstaged changes area of the Git staging window marked with an x as deleted. This is a jsp project running google app engine if it matters.
What got me to this point was attempting to checkout the master branch. I got an error saying the branch could not find 2 files and afterwards my working files in the current branch disappeared. The Git repositories view shows my current branch is the same as the one I had been working on, so these files should normally be visible.
Since I never chose to delete these files I have no idea what stage egit thinks it's in. I don't have a backup and my other branches haven't had recent changes merged in.
You can always see the state of Git as a text decoration next to each repository node in the repositories view of the Git perspective. Normally that should only show the branch name, but it might also be something like "Interactive rebase", if Git stops for user input in the middle of an operation.
If that is not showing the branch name you want, then just the context menu Switch->[branchname] should bring you back to the wanted branch.
If everything else fails, you can always throw away all local changes and have your local working directory reset to the state of any commit (or branch) by using context menu->Reset->Hard and select the commit (or branch) to which you want to reset. Be aware that this wipes out any uncommitted local changes.
In case of more questions, you should read the very detailed EGit user guide.

EGit deleted my workspaces

So I need some serious help. I was looking into using EGit in eclipse. I created a test project and Team > share to a local git repository. I than committed the project to the repository. Cool I thought, but I didnt need this repository so I deleted it. Than my entire Project Explorer went empty and my Folder that contained all my workspaces is GONE. I am kind of freaking out right now, anyone know what to do?
When you select Team > share Project, EGit has to move all the files of the selected project(s) to the Git repository that you selected. EGit has to to that because you can't track files with git that aren't located inside the repository.
However, this makes your workspace look empty. The whole project seems to be gone. In fact, it isnt. In some config file is noted that the project has been moved to another location.
If you delete your repository, you also delete the files in it (it is a normal directory, remember that!). That means, if you really deleted your repository and did not just removed the link to eclipse so that it doesn't display the repo anymore.
Other than that, egit doen't touch anything else. It will only move the projects that you selected, and it will move it only to the location you told egit (the selected repository).
If you are sure that you lost projects you didn't select and/or one or more completly unrelated workspaces by doing what you have written above, than i suspect you found a bug as heavy as this one: https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commit/a047be85247755cdbe0acce6f1dafc8beb84f2ac

Changing git branch while working with eclipse (what's proper order)?

my problem is that sometimes I change git branch while working live in eclipse. But I do not know what should I do (in what order to to, to don't make mess in both projects).
So my procedure is:
eclipse is open (working on some problems)
git change branch
eclipse > selecting projects and clicking to refresh
work on eclipse, continue job
Is it all right or I should use first Clear&Build and then refresh projects? What do you think, is it important witch order do this while changing branch ? Please help because I am working with friends on big project and I do not want break anything.
If you are working on a particular branch and you want to preserve whatever it is you have been doing, you should add or commit those changes first (git add or git commit) to that branch before changing to a different branch.
If you have the same projects in both branches, then refreshing the projects after changing branch should be fine, but ideally followed up with a clean/build.
If you want to be really safe, you can first close the projects before changing branch, then refresh and re-open them after changing branch.

How can I see where I am comitting to using team > commit on eclipse using svn / subversive

When I right click on a project and select commit it does not show the repository URL of where the commit is going in the commit window, which can be pain for developers. Is there a way to enable this?
Above the project I can see a path along the lines of https://repos.domain.com/repos, Trunk:trunk
Unfortunately this is not always accurate. For example when I am on a branch called MyBranchand select Team > Branch it makes the new branch within the MyBranch branch folder, instead of creating it within the branches folder. I've made this mistake a few times but by my project it will tell me:
https://repos.domain.com/repos, Branch:newBranch
when the path is https://repos.domain.com/repos/project/branches/MyBranch/NewBranch instead of https://repos.domain.com/repos/project/branches/NewBranch
Is there a way to improve on this level of accuracy?
Perhaps, Subclipse would be a better option.
Here's a screen shot of the Subclipse commit window on Eclipse 3.7. The Subversion directory is right at the top of the window.
Looks like Properties > SVN info. I didn't about this and was looking for something within the team menu. I'll leave the question open incase there is a way to view the full repository path next to the project.

Eclipse and EGit: How to easily review changes to ALL modified files before committing to *local* repository

I'm using Eclipse Indigo SR2 with the (built-in) EGit plugin v.1.3.0.201202151440-r and haven't been able to find any way to easily review all my changes before making a commit.
I used Eclipse with SVN for years, and this was always very easy to do. I would typically right-click on my project, select Team->Synchronize, double-click on the first changed file (in the Team Sync perspective), then hit Ctrl-. repeatedly to review all changes in one file, and then proceed to the next file, as I wrote a summary of my changes for the commit message.
But of course, git is very different from Subversion, and so my workflow must change. With EGit, "Team Sync" only appears to be useful for reviewing changes between my local files and the remote repository (i.e. before a push to the remote). I need a way to review changes since my last commit to my local repository. I generally don't even care to (re)review changes before a push to remote (and if I did, I'd prefer a simple equivalent of git log to see what commits I'm about to push).
If I right-click on my project and select Team->Commit, I am presented with a window that does almost everything I need to do (select files to stage, commit, write a commit message, amend a previous commit, etc.). What it doesn't allow me to do is quickly and easily review all my changes in a compare editor. I can't believe this capability doesn't exist! It seems I am required to double-click on each individual file, review the changes, close the compare editor, and double-click on the next file. That's ridiculous!
TL/DR - I am looking for a simple GUI equivalent (in Eclipse) to do what I am easily able to do from the command line using git vimdiff (where vimdiff is a git alias that uses vimdiff as the "difftool" to cycle through all modified files) followed by git commit (with perhaps a git add or two in between).
If no one has a good solution, I am curious about how others handle their commit workflow with EGit. I've been getting along fine committing from the command line (not that Eclipse is happy about that) but I can't believe that EGit is as near-useless as it seems to me. Perhaps my google-fu is not as strong as it once was?
Says here that you can see the diffs between the working tree and any given reference. Perhaps you should try out the latest version (Juno) of Eclipse/EGit and see if it's gotten any better?
Update: I've tried this out in the latest Eclipse, and as far as I can see it works fine. Here's how:
In the moment of writing this, Eclipse Juno 4.2 is the version you should go for. On the download page, you can pick between several packages according to your needs. The 'Eclipse IDE for Java Developers' comes bundled with EGit, but you can also install EGit into any distribution using the Eclipse Marketplace (under the Help menu).
Once you've imported your project into Eclipse, make sure the project is "shared":
Right-click project -> Team -> Share Project.. -> Git
Now do the following:
Switch to the Team Synchronizing Perspective.
Click the little synchronize button in the Synchronize View.
Choose Git
Pick a suitable branch to sync against, like refs/remotes/origin/master
Make sure to check the "Include local uncommitted changes in comparison" box
Click Finish
Now, change some files and watch them appear in the Synchronize View. Double-click the changed files to see the diff (like in the screenshot below).
Are you aware of the 'Git Staging' view. It keeps track of all the files that have changed and you can review the changes any time. (This can be a bit better than using the commit dialog)
An alternative is to commit all changes without reviewing, and then use the history view to compare two commits (Simply select the last top most commits, right click and select 'Compare with each other'). This way you do not have to keep double clicking individual files. If you need to change something you can always 'Amend' the last commit. (I usually follow this approach)
I am writing this as of Eclipse Oxygen, but it should apply to other versions as well.
Option 1 with team synchronizing view: right click the project > Compare with > Commit. You can choose your latest commit here, even if you haven't pushed it to repository.
Option 2 with diff view: If you want to see the "diff" version without committing, you can achieve this by right clicking your project > team > stashes > Stash Changes > check Include untracked files. This will save all of your changes to a stash. Then you will right click project > team > stashes > select stash you saved. You click the green arrow at the top right to re-apply all of your changes you stashed back to your code. In the same stash window, you will see a "Diff" tab at the bottom right. Clicking on the diff tab will show your changes in the red/green highlighted diff style. I wish there was a way to generate a diff view without stashing, but this is the only work-around I have found.