path: root/
diff options
authorShawn O. Pearce <>2006-12-16 02:53:09 (GMT)
committerJunio C Hamano <>2006-12-16 06:31:01 (GMT)
commitaeb80c70ec2baebbf107de0ea5293984798ddd24 (patch)
treed3b28c73075fefae827caa5fbfcc8d137df60b9f /
parente697e4cd1fc492e312a396211bafc629d6297ebd (diff)
Suggest use of "git add file1 file2" when there is nothing to commit.
If a user modifies files and runs 'git commit' (without the very useful -a option) and they have not yet updated the index they are probably coming from another SCM-like tool which would perform the same as 'git commit -a' in this case. Showing the user their current status and a final line of "nothing to commit" is not very reassuring, as the user might believe that Git did not recognize their files were modified. Instead we can suggest as part of the 'nothing to commit' message that the user invoke 'git add' to add files to their next commit. Suggested by Andy Parkins' Git 'niggles' list (<>). Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 1 insertions, 1 deletions
diff --git a/ b/
index a30bda1..6bce41a 100755
--- a/
+++ b/
@@ -520,7 +520,7 @@ then
current="$(git-rev-parse --verify HEAD)"
if [ -z "$(git-ls-files)" ]; then
- echo >&2 Nothing to commit
+ echo >&2 'nothing to commit (use "git add file1 file2" to include for commit)'
exit 1