Is there an editor that recognizes merge conflict tags and displays the sections side by side? Preferably something like p4merge?
<<<<< local
...
=========
....
>>>>> remote
our tool ECMerge (http://www.elliecomputing.com) does that, it has a Open Conflict file menu which works with markers from SVN, CVS, Mercurial, Bazaar, Git and Perforce.
the menu is present also in the explorer plugins for Windows Exlorer, Nautilus, Konqueror and Thunar on Linux.
My approach to this has been to use KDiff3 (an extremely useful tool for diff/merge) and feed it 3 files extracted with git cat-file and git ls-files -u. It is a bit of work, but then I get to know exactly what is going on. Git have added support for configuring a specific merge tool, so probably it should be possible to do the operation more simpler than
Related
I sometimes realize a local commit with Eclipse and then decide to push my project but Eclipse offers me only two solutions "Commit and Push" or "Commit".
The problem is I cannot make a "commit and push" if I haven't changed anything after my "Commit".
Fair enough, I only have to change a line on my code and can push it but it seems to me like an awkward solution. Is there a better way to do so?
You can always just open Eclipse's built-in terminal (or any other terminal app) and execute: git push.
On a side note: getting used to using git on the command line enables you to easily switch between different IDEs and editors without having to re-learn the respective quirks of the git integration of the IDE de jour every time you switch.
In the Package Explorer, Project Explorer, etc. right-click the project folder and choose Team > Push to Upstream.
Alternatively, you can use Quick Access (Ctrl+3) and enter push to upstream (assuming a file of a Git repository is selected or opened).
For a Git main menu and Git icons in the main toolbar, in Window > Perspective > Customize Perspective..., in the tab Action Set Availability check the checkbox Git.
I use a variety of eclipse's for different uses, and for any backend work, my preference is Aptana, only problem with it, I feel is I think it's got a funky Git installation, which doesn't operate anything like EGit, which is common on the other versions I use.
The biggest irritation I have is comparison (with HEAD), and 'Show in history'. I've attached screenshots to show what I mean (all against the same project and file, a git tracked 'MANIFEST.in' file),
'Compare with' in Aptana:
In Android Developer Tools:
In Flash Builder:
'Team' context view in Aptana:
In the others:
I already have eGit installed,
Funky Aptana git plugin,
Any notion as to how to get rid of (what I deem to be) the funky Aptana one, and instead use the proper, more functional and standard eGit one?
Per request:
There's an option which should disable Aptana's Git in Preferences > Team > Git > Automatically attach our git support to projects added that have git repositories
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.
I have some files that I want to commit:
C:\Dir1\Dir2\Data\dfile1.txt
C:\Dir1\Dir2\Tools\tfile1.xml
When I try to use svnClient.Commit(ICollection) for the above paths, I get 'Dir2 is not a working copy' error.
However, if I commit them one by one in a loop, it commits fine. Apparently, svn signature exists for the Data and Tools folders but not for the Dir2 folder.
Any ideas on how to do a batch commit ?
Edit: More info: If I select Dir2 via tortoise svn, I do not see the 'svn commit' option but if I select 'Data' and 'Tools' together with my mouse on the right hand side of my windows explorer, I can see the 'svn commit' option.
There's no real solution to you problem. What you're seeing is correct behavior of both tools. TortoiseSvn will commit Data and Tools in a loop when you go ahead and do that. SharpSvn only offers the Commit(ICollection) overload to commit multiple files within the same working copy. In your case Data and Tools are separate working copies (from what I understand so far).
I'm using Eclipse with the MercurialEclipse extension to use the Mercurial SCM.
I have lots of projects and every morning I want to pull all latest changes before starting to work. With SVN or CVS I could simply select all projects and click Team/Update. But the Team/Pull command of MercurialEclipse is disabled when multiple projects are selected.
So currently I have to call Team/Pull on each project separately. That's really annoying. How can I pull changes for multiple projects in one go?
I would rather use an external script than trying to do it directly from Eclipse.
See for instance:
Mercurial Repository Nightly Pull from a subdirectory on a server (for the idea)
Updated Mercurial Batch Pull/Update Python Script (for an actual complete script)
Then a simple refresh in your Eclipse environment would be enough.
You could highlight them all, right click, and choose synchronize. You could then pull from this view if desired (plus it will show you changes).
One not-quite-what-was-intended solution would be to make each a subrepo of of parent repository. Something with a .hgsub file of:
project1 = project1
project2 = project2
...
would be enough for 'hg pull' in the top level to do a pull in all of them.
You're probably better off just scripting it though. I don't know what eclipse offers for scripting but from the unix command line that would be:
for therepo in $(find /my/project/root -type -d -name .hg) ; do
hg --repository ${therepo%.hg} pull
done