Using Git, how can you find the difference between the current and the last version?
git diff last version:HEAD
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t really understand the meaning of "last version".
As the previous commit can be accessed with HEAD^, I think that you are looking for something like:
That also can be applied for a :commithash
As of Git 1.8.5,
@is an alias forHEAD, so you can use:The following will also work:
If you want to know the diff between head and any commit you can use:
And this will launch your visual diff tool (if configured):
Since comparison to HEAD is default you can omit it (as pointed out by Orient):
Warnings
~character must be used instead of^.