I am using the eclipse plugin for Git on Mac OS 10.6, and I cannot figure out how to compare two version of a file. I can pull up the file's history, and see all of the commits, with their messages, but I can't figure out how to see what changed in each commit.
This was very easy with subversion, and I'm sure its easy with Git, if you know where to look (but apparently, I don't).
Any pointers would be greatly appreciated.
To elaborate on my question, is there a way to access git-diff in the eclipse plugin?
From the EGit User Guide:
select a Resource (project, folder, or file) in the project explorer
or navigator and right-click an action under Compare With.
I just tested this with EGit 1.3.0. You can compare with a commit, HEAD, previous revision, "branch, tag, or reference", Git index, or any item in History.
Related
I try to ignore a committed ".project" file on Eclipse EGit, without deleting it from my Eclipse project nor the repo.
I have this need :
the ".project" file of my Eclipse project must be committed at least
at the begining of the project, so that my co-workers can pull it
when they will "build" their Eclipse workplace
this file could be modified by any of us, but should not be pushed on GIT repo
this file must stay on GIT repo all the time, because a co-worker could have to get back the project at any time
we are working on Windows, so using command-line is a bit off-subject : I seek for help on Eclipse EGit
We are migrating from SVN to GIT : on SVN, we did not had this kind of problem, because we could not commit some files. On GIT, it seems that we have to commit everything we modify so that we do not have conflicts.
Can anybody help me ?
Thank you !
Right-click the file and choose Team > Advanced > Assume Unchanged.
See Eclipse Help - EGit Documentation - EGit User Guide - Reference:
Resources can be flagged "assume unchanged". This means that Git stops
checking the working tree files for possible modifications, so you
need to manually unset the bit to tell Git when you change the working
tree file. This setting can be switched on with the menu action
Team > Assume unchanged and switched back with the menu action Team > No Assume unchanged.
It should be noted that each co-worker must do this once. A server-side Git hook could reject commits changing .project if a co-worker had forgotten to do so.
I'v tried to merge a hotfix of my current deployed release branch into my develope branch.
Intellij found only the changes that were in the hotfix.
eclipse on the other hand found additionally some changes between the release and the develope and put them on the unstaged files.
Why is there a difference between the 2 IDEs? Do they use different git merge or diff? Do they choose different common ancestors?
Thank you!
No, IDEs don't have anything to do with GIT internal commands.
I think it was a mistake from your own side. I suppose you have two local repos for two IDEs, right?
May be you accidentally merged with different branch.
You said eclipse put some files to upstaged change, may be there's a conflict to that merge. Resolve it.
I have an eclipse project with which I'm using subversion and subclipse. Currently the top level folder of the project is showing the dirty decorator even though when I do a "Compare With->Latest from Repository" the response is "There are no differences between the selected inputs." Furthermore, an "svn diff " from the command line shows no differences.
Here's a transcript:
[ollie#devdataload workspace]$ svn diff DataLoadEagleOliver
Property changes on: DataLoadEagleOliver
___________________________________________________________________
Added: svn:mergeinfo
Merged /FinancialReport/trunk/Java/DataLoadEagle:r1178-1186
[ollie#devdataload workspace]$
Is this expected behavior and I'm missing something or is this a know issue with subclipse?
I'm using subclipse 1.6.18 and Eclipse Indigo. The next thing I'm going to try is upgrading subclipse to the latest version.
The svn diff does show a difference: the svn:mergeinfo property. This might not show up when you do Compare With, but it is a difference, and you should probably commit it.
That property is automatically changed whenever you merge from another branch. It keeps track of which revisions have already been merged, so it can skip them the next time you merge from the same branch.
The commit or revert options are good ways to see which paths have changes. When the change is only to a property, those dialogs will have a decorator to show this. The Eclipse compare options are focused on file content so you cannot really see property differences in those editors.
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.
I'm using eclipse and Subversion (SVN) is my new version control.
Till now I used to use Concurrent Versions System (CVS) as my version control and after deploy operation I used to tag my projects with Tag as Version in eclipse like this:
Team --> 'Tag as Version..' --> Version-X-Y-Z
How can I do it now using SVN?
Normally, SVN has three root level directories,
trunk
tags
branches
In SVN server, for each project, you have the same above directory structure.
'trunk' is where you keep your ever developing code base.
'tags' is used for the same purpose that you've indicated. i.e. for versioning.
'branches' is used for things like feature developments/individual development.
An example,
Let's say I am developing a database synchronization application which will go out as Pilot release, Moonshine release, Kilimanjaro release, Great release and onwards..
I start in 'trunk' and continue my development for let's say 2 months at which time I am ready for Pilot release..
Then I create a 'tag' of the 'trunk' which I can name 'Pilot tag' which will be released to customers..
Now my main feature developments for next release which is 'Moonshine release' will continue in the 'trunk'. If their are any immediate bug fixes or show-stoppers in my 'Pilot release' those will be done in the 'Pilot tag' and released to the customers immediately..
However since the above fixes are not in my 'trunk' code, sometime later (before releasing the Moonshine release) I will 'merge' the modifications done in my 'Pilot tag' back to 'trunk'.
Here, there can be conflicts since the same code lines could have been modified in both 'Pilot tag' (for bug fixing mentioned earlier) and in 'trunk' (for feature modifications/development of new release). In this situation, you have to carefully review the conflicts, edit any such conflicts and accept the changes.
TortoiseSVN is the primary client tool for using SVN. It embeds features directly to your Windows right click menu for all above mentioned functionalities like commit, update, merge, branch (i.e. tag or branch) etc.
And for conflict resolution I personally prefer 'Beyond Compare' which is a third party application which you have to buy. You can setup TortoiseSVN to invoke Beyond Compare as the application for conflict resolution and it is far better and user-friendly than the built in conflict editor in TortoiseSVN tool.
You would need to install an Eclipse Subversion plugin like subclipse or Subversive. This will provide the same facility as that available for CVS.
For instance, here is the documentation on how to tag using Subversive.
To TAG, using Eclipse with SubClipse:
select Team, Branch/Tag, then click the 'select' button and drill into the appropriate project, then click 'tags' directory, and drill down to your last tag name or any similar name you plan on creating.
The full URL is copied into bar, then you can edit it changing the rightmost tag name portion to any new tag name.
Click next, select from HEAD (HEAD is referring to the repo path you have established already on previous page so in fact may be the Head of a Branch).
Enter a comment like 'tagging <appName> Release <for reason> version x.y.z'
Finish -
You can prior to this point or after, open the Eclipse 'SVN Console' from dropdown on right bottom of page, and see most recent SVN commands generated and there results.
Every checkin in SVN creates an new revision number. SVN revision number should be equivalent of your tag. Remember the SVN revision number for the production build.
Tagging and branching in Subversion works differently from CVS. In Subversion, "to create a tag" means to copy a revision (typically HEAD, but it can be some other revision) to a new directory within the "tags" directory. That is why, when you go to Team->Branch/Tag..., Eclipse is asking you for a URL to copy to.
Check out this page for a more detailed explanation of tagging in Subversion.
To help you understand how things are done "the SVN way," I'd recommend practicing Subversion usage from the command line, before trying it on Eclipse. Or, if not, at least open an SVN console in Eclipse to see the commands that it runs--you'll see that the tagging operation is indeed an svn copy.