Eclipse和EGit:在提交到* local *存储库之前,如何轻松查看所有修改的文件的更改 [英] Eclipse and EGit: How to easily review changes to ALL modified files before committing to *local* repository

查看:154
本文介绍了Eclipse和EGit:在提交到* local *存储库之前,如何轻松查看所有修改的文件的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse Indigo SR2与(内置)EGit插件v.1.3.0.201202151440-r,并且在提交之前无法找到任何方式轻松查看我所做的所有更改。



我使用Eclipse与SVN多年,这总是很容易做到。我通常会右键单击我的项目,选择 Team-> Synchronize ,双击第一个更改的文件(在Team Sync透视图中),然后点击 Ctrl - 重复查看一个文件中的所有更改,然后继续执行下一个文件,因为我写了关于提交消息的更改的摘要。



但是当然,git与Subversion非常不同,所以我的工作流程必须改变。使用EGit,Team Sync似乎对于查看本地文件和远程存储库之间的更改(即在推送到远程之前)是有用的。我需要一种方法来检查自我上次提交到我的本地存储库以来的更改。我通常甚至不关心(重新)在推送到远程之前检查更改(如果我这样做,我更喜欢一个简单的等价物 git log 来查看如果我右键单击我的项目并选择 Team->提交

c>,我看到一个窗口,几乎我需要做的一切(选择文件进行分段,提交,写提交消息,修改先前的提交等)。它不不允许我做的是快速,轻松地查看比较编辑器中的所有更改。我不敢相信这个能力不存在!看来我需要双击每个单独的文件,查看更改,关闭比较编辑器,然后双击下一个文件。这是可笑的!



TL / DR - 我正在寻找一个简单的GUI对等(在Eclipse中)来做我可以从命令行使用 git vimdiff (其中vimdiff是使用vimdiff作为difftool循环遍历所有修改的文件的git别名),后跟 git commit (可能有一个 git add 或两个之间)。



如果没有人有一个很好的解决方案,我很好奇他人如何用EGit处理他们的提交工作流程。我从命令行一直很好地承诺(不是Eclipse对此感到高兴),但我不敢相信EGit在我看来是没有用的。也许我的google-fu不像以前一样强壮?

解决方案

你是否意识到Git Staging视图。它会跟踪所有已更改的文件,您可以随时查看更改。 (这可能比使用提交对话框好一些)



另一种方法是提交所有更改,而不进行查看,然后使用历史记录视图比较两个提交(Simply选择最后一个最多的提交,右键单击并选择彼此比较)。这样,您不必双击单个文件。如果您需要更改某些内容,您可以随时修改最后一个提交。 (我通常遵循这种方法)


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?

解决方案

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)

这篇关于Eclipse和EGit:在提交到* local *存储库之前,如何轻松查看所有修改的文件的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆