I have tried git commit -v
ubuntu@ip:~/agile$ git commit -v
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .htaccess
#
no changes added to commit (use "git add" and/or "git commit -a")
ubuntu@ip:~/agile$
But it is just showing me that .htaccess has changed, but not what has changed. How do I achieve this?
Update:
In Aptana Studio it is possible to see the changes before you commit anything. So back to my question, there must be a way to see the difference to the original state, before you actually commit. Maybe there is a different command for that.
Make sure you’ve staged some changes. Otherwise,
git commit -vwill show you a block similar to what you posted, but not do anything. You can stage changes manually withgit add, or if the files are already versioned, you can usegit commit -a -vto stage and commit the changes.For example:
Staging the change shows the diff with
git commit -v:If you just want to see the diff without committing, use
git diffto see unstaged changes,git diff --cachedto see changes staged for commit, orgit diff HEADto see both staged and unstaged changes in your working tree.UPDATE: given your edit, what you really want are the
git diffderivatives above. I’m not sure how Aptana Studio works. It may not follow the typical command line git flow. On the command line, you’d stage your changes, and then commit. And the abovegit diffcommands are what you’d use to examine those changes. I typically alias them asgit unstaged,git staged, andgit bothby adding this to my~/.gitconfig: