Eclipse EGit | Branch Diff - eclipse

Currently using Eclipse Mars.1 and installed EGit from Eclipse MarketPlace.
Does Eclipse EGit has a similar feature of SourceTree wherein you could pick N or all commits inside a branch and compare it (git diff) to which branch is was checked-out from?
I was trying to follow low-level git branching standards relying only on Eclipse EGit tools (without terminal, SourceTree, Pull Request functionality, et.al.). But I'm only limited to seeing commit-diffs and not a branch-commit-diff view.

I think you can compare anything to anything in egit.
e.g.:
You can click on any two commits in the History view and, from context menu, choose Compare With Each Other
You can select two branches in the Git Repositories view and, from context menu, choose Synchonize with each other
You can right click on any branch in the Git Repositories view and choose Synchonize with workspace
And the list goes on ad infinitum (practically).

Related

how to know recent code check-ins to the SVN repository

I want to know about what are the list of files, which are checked-in to the svn repository recently in the eclipse IDE.
Thanks.
Switch to the SVN Repository Exploring perspective, select the repository and choose "Show History" from the context menu. This will show the repository history in the History view.
Select one of the history revisions to see the list of changed files.

How to show current git branch in Eclipse toolbar

Is there a plugin or some setting in EGit to show the current git branch in the toolbar of eclipse so that it's visible on which branch you're working?
Like Sasikanth says there is no toolbar in EGit that shows the current branch.
Since there usually are multiple repositories within your IDE, a toolbar that shows the current branch of a single repository would probably often choose the wrong repository to display.
But if you have an idea how such a toolbar could work you may want to open an enhancement request.
In the meanwhile you can either use the Repositories View to see the current branch of each repsoitory or look at the Pakckage Explorer or Project Explorer. The projects are decorated with the repository they belong to and the current branch that is checked out.
Here the project belongs to the gitexample repository on branch master.

No option for switching branch in Egit

I created my own project in Eclipse (Kepler version for Parallel Apps) using PyDev, then pushed it to GitHub.
Now, when I try to switch branch using "switch to" in Eclipse, there is only one option: "New branch". It doesn't allow me to switch to any existing local branch or to look for remote branches. But on the other hand I can switch to another branch from command line or even from Eclipse "Repository view".
I thought it might be problem of configuration of my branches, so I created new branch on Github and downloaded project again. It was fetched, but unable to use "switch to" option.
But when I download other projects from GitHub I can switch to other branches.
Any ideas where is a problem?

Changing the git branch on eclipse

This is the first time I do this.
I imported a git project in eclipse.
Then I used the shell to create another branch and checkout to the new branch.
Is refreshing the imported project in Eclipse enough to tell Eclipse that we are working on the new created branch?
thanks
Right-click your project and select Team → Branch to create new branches or to switch between existing branches. You can also switch branches in the History view.
Actually, I don't think you even need to refresh the project. That is, assuming you have 'eGit' installed and your projects are already configure as git projects (they should be, because in most cases, egit does that automatically).
Whenever you run git commands on the shell (outside eclipse) egit will automatically refresh projects for you and update their status when you switch back to Eclipse.
If you are not using egit then yes, you have to refresh the projects manually, but that is all you'd have to do since running the 'git checkout my-branch' command in the shell already changed the files on disk to be those from 'my-branch'.
Actually when you are working with eclipse, eGit is a very cool tool integrated inside eclipse, which lets you do all git stuff, like
git checkout to a new branch
git create new branch
git stash
even view your unstaged changes(select files and avoid complexities caused by git add .)
and finally commit.
Read here to know more. Eclipse Egit user guide
So you get to do all version repository stuff at one place as you code.
So to answer your question, yes as you checkout a new branch even in a shell/command prompt your changes will be reflected in eclipse.

Pull multiple Git repositories with EGit on Eclipse at once

I have cloned ~60 git repositories and I would like to update the most of them with git pull through EGit. Not all, because some of them have uncommited or unstaged changes.
My first try was to select two repos in EGit (Git Repository Exploring view) but unfortunately this seems not to be possible, since the affecting button is disabled (context menu).
Does andbody know a good solution to update some repositories through Eclipse?
I am using Ubuntu 12.04 and Eclipse Juno. Sure, a shell script could solve this but I prefer Eclipse for this.
I just discovered the answer, using Kepler. This was a nightmare for me with 15 repos.
Eclipse->Windows->Preferences->General->Keys. Now scroll to Pull (make sure it's the egit one)
Set it to something like Ctl-Shift-P
Now in package explorer select the ones you want and press Ctl-Shift-P, done.
Sometimes the solution is too simple: one of my cloned repositories had no HEAD and therefore I cannot pull from it. All other repos had a HEAD revision and pulling from them works as expected.