开发者

How to checkout a file into previous revision in egit

could please anybody tell us if it is possible and if it is not, what is the best alternative to do it ? This is how it would be do开发者_如何学运维ne in command line : git checkout HEAD~1 -- path/to/file

But if the project is big, navigating to that file in cmd can be annoying ....


You can do this with EGit version 1.0 or higher (it might also be possible with earlier versions, but 1.0 is the first version I noticed the feature).

  1. Right-click on the file you wish replace with an earlier commit, and select Replace With -> Commit...
  2. You will be presented with a list of commits to choose from. Select the commit you wish to replace the file with.


This is available in EGit 2.0:

Select the file(s)/folder(s) you want to replace with another version and use any of the commands:

  • "Replace with > Commit..."
  • "Replace with > HEAD revision"
  • "Replace with > Branch, Tag, or Reference"
  • "Replace with > File in Git Index"


I know you can reset your full history to a previous commit. I don't know about just one file.

This is why I don't recommend anyone using Egit. You will out grow it in a few days of usage.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜