I'm using git via the Eclipse egit plugin. I am new at using git as my VCS and was wondering if there was a way to create a patch that captures the changes across multiple commits from within Eclipse. For example:
- Work on a new feature
- Commit work
- Fix a bug
- Commit work
- Create patch of code added since开发者_Python百科 #1
Can this be done from within eclipse using egit? If not, what is the command line for doing this?
The git command you're looking for is:
git diff HEAD~2 HEAD
HEAD
means your current commit, and ~2
means "two commits before".
I'm not sure if egit can do this, but I'd look for some sort of arbitrary diff functionality: "diff against... [commit]".
精彩评论