How to use MercurialEclipse? - eclipse

I have been using the built in mercurial support in NetBeans for a while now and its great. I just recently installed MercurialEclipse from http://cbes.javaforge.com/update so I can start using Mercurial for my Flex projects as well.
I can't seem to figure out how to use it.
I watched the video, when I right click files in the Package Explorer and go to tools I only have 2 or 3 options: Apply Patch, Share Project [, Show Local History]
When I click show local history, it says:
No local history for selected resource.
My project is a repository and I have made some changes since the last commit. I would like to see a diff of those changes so I can review them before committing.
Is this possible?

You need to click "Share Project" and enable Mercurial support for this project.

Related

How Can I Revert an Update from an SVN Repository In Eclipse?

I need to revert back to a local dev environment after having replaced it with the contents of an SVN repository? I'm using Eclipse Luna, SVN, Subversive, Spring MVC.
I would like to revert back to what I originally had as much was deleted from doing an accidental replace.
I'm not exactly sure what you mean by a "replace" but there are a couple of things you can try to restore the state of your projects.
Firstly, you have SVN revert. Right-click on the project in the Package Explorer, go to "Team" and then choose "Revert" from the sub-menu. This will give you the option to restore the state of local files based from Subversion.
If that's not what you're looking for then you've got Eclipse's built-in local history. Again, if you right-click on the project in Package Explorer then you should see an option to "Restore from local history". If you select this then you'll be presented with several historical snapshots of the files with which you've been working, so you can hopefully resurrect the desired state of your work from that.

Can't pull a Gradle project in Eclipse

I'm part of a team working on a game project and we just moved our project to using Gradle. I can pull, commit, merge and push normally with Git GUI in Windows Explorer, but other members of the team can also pull in Eclipse by right-clicking the Gradle-project folder in Project Explorer view, choosing Team-menu and then Pull. However, in my Eclipse the "Team" settings only give me options to "Apply Patch" and "Share Project.." the whole team has tried to find a solution for this to no avail so far.
Before the project was built on Gradle, I was also able to pull in Eclipse by using the aforementioned method. We're using Git repository.
Any suggestions on where to look for the cause of this malfunction?
Thank you.
I assume then you don't store the Eclipse project files/settings in your Git repository but create them locally using gradle eclipse.
Then after importing the project into Eclipse (be sure not to copy it to the workspace) you can use the Share project... option under Team in the context menu. Then choose Git. Eclipse EGit will automatically detect if your project resides in an existing repository (it should be listed on the next wizard page) and set up the corresponding association.
The term Share project maybe is a bit confusing, as you also do it for projects that already are under version control.

Eclipse Git Synchronize does not display changes

No matter what I do, Eclipse (EGit) doesn't display the changes. I've searched a lot for this issue, but cannot solve it. A friend of mine has the same issue. In the past everything worked fine, but from one day to the other the issue occured.
When I hit Team > Synchronize Workspace, only the dialog "Synchronizing Git: No changes found." appears. When I choose Team > Advanced > Synchronize, the same happens.
I also installed a new Eclipse (with a fresh Windows) and issue was still there. With my Ubuntu notebook everything is fine.
Does anybody have the same issue? Is there a solution? I also tried to install the plugins mentioned in this answer, but it didn't work for me.
Update
Eclipse also displays incoming changes (after fetching from upstream) and the changed files (with an arrow), but the synchronize view still doesn't show the changes.
Update 2 I've tested a project from Github and there everything works as apected. What could be the difference between these two projects? I've checked the repository settings and they are equal. Could the authentication cause the issues? Like I've said, the project works fine on my Ubuntu machine.
I've tried the new EGit, re-cloning the project and nothing worked except this:
In the Synchronize view, click on the dropdown arrow next to Synchronize button, then select "Synchronize...".
In the dialog that appears choose Git, press Next.
Then the crucial part - select destination to be HEAD for your repository and check "Include local uncommitted changes in comparison".
Click Finish.
I used to have the same problem but upgrading to EGit 2.2 seems to have taken care of it. Things are now consistent between "git status" at command line and "Team / Synchronize Workspace" in Eclipse.
You can get EGit from here or you can add the update site http://download.eclipse.org/egit/updates-2.2 to Eclipse.
Latest Egit Update Site:
http://download.eclipse.org/egit/updates
Before you can synchronize your workspace, you need to do a "fetch" from the remote repository (Team -> Fetch from Upstream) to get all the incoming changes into your local repository. Afterwards you can synchronize them.
If you don't want to make two clicks for synchronizing, you can enable "Always launch fetch before synchronisation" in Preferences -> Team -> Git -> Synchronize.
Staged ChangesThis has worked for me :
Whenever you made any changes. Right click on your Project name then Go to Team and click on "Add to Index". Now again Right click on your Project Name then Go to Team and click on "Commit". Now You will see that Git Staging console has been opened and the changes you have made are started displaying in Staged Changes box.
We were strugeling with the same problem. It turned out that we had to remove all options in Git->Synchronize preferences.
We are using Eclipse Juno and Kepler. Removing the options solved the problem for both.
If it helps anyone, I ran into the same problem.
During synchronization, in repository selection, the option Include local uncommitted changes in comparison is not checked and shows No changes found in the Synchronize view. Synchronizing with that option checked, shown the changes.
Eclipse Version: Luna Service Release 1 (4.4.1) - MacOS

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.

Eclipse Egit Not Detecting Changed Files

I have been using Egit and Eclipse together for well over a year. I recently upgraded my computer and had to reinstall everything. Previously whenever I would make a change to a file it would immediately get picked up by Egit and show with the red highlight and star next to the file name in the project explorer.
I have everything back up and running exactly as it was, however whenever I make a change the change is not picked up by Egit. I have to perform a 'git status' in order for the files to show as ready to be staged in the file explorer. Am I doing something wrong to have Egit automatically detect changed files and has anyone else had this problem?
which version of EGit are you using
do you get the egit team menu if you right-click any resource in your git tracked project ?
if not then you need to do "Team > Share > Git", then check "Use or create repository in
parent folder of project". If you are using a very recent nightly build version this
will be checked automatically.
when you modify a file tracked by (e)git a text decorator ">" should
appear in front of the modified file
as soon as you stage the modified file (Team > Add) the decorator should show the star
also the staging view should always show the git status for all modified files
You need to "Add to index" all files again probably
Track Changes Click Team > Add on the project node. (This menu item
may read Add to Index on recent versions of Egit)
(From the EGit docs:)
What I've found is that you need to make sure that your git repositories are showing up in the Eclipse Git Repositories view.
In the repositories view, you click on the [very] little Git icon with a green + (plus) sign to Add and Existing Local Git Repository.
Browse to the directory that already has a .git subdir and click Finish. You should then see you local repo show up in that list.
Then you can right click on the repo while still in the repositories view and add pull down to Import Projects.
"Import existing projects" is selected. Click Next.
Your project should be checked off. Add it to a working set if necessary. Click Next (maybe Finish).
I had a similar issue where all my changes just disappeared. Somehow, Eclipse had unselected my Git repository. Once I selected it again, they all came back.
If you have already added your files to Stage then change the branch it will ask you to commit/stash/reset
I faced the same problem. From your git repository view: Right-click -> Show in git staging
For me I have clicked Team --> Advanced --> No Assume Unchanged, fixed the issue
I faced the same problem using eclipse version 2021.12. Whenever I made changes on file, the eclipse didn't detect it.
I solve it by using Intelij IDE.
i just faced this problem by now, and i resolved by clicking in button Refresh in Git Staging: