Command | New files | Changed files | Deleted files |
Alice/> git init
Initialized empty Git repository in /home/rene/github/github/git-internals/repos/commit-a/Alice/.git/
snap no: 1 | | | |
Alice/> echo foo > foo.txt
snap no: 2 | | | |
snap no: 3 | | | |
Alice/> git commit -m "foo"
[master (root-commit) 0349c36] foo
1 file changed, 1 insertion(+)
create mode 100644 foo.txt
snap no: 4 | | | |
Alice/> echo foo foo > foo.txt
snap no: 5 | | | |
Commiting without specifying -a will only commit files that were explicitely added
Alice/> git commit -m "foo foo ?"
On branch master
Changes not staged for commit:
modified: foo.txt
no changes added to commit
snap no: 6 | | | |
Alice/> git status
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: foo.txt
no changes added to commit (use "git add" and/or "git commit -a")
snap no: 7 | | | |
Nothing was commited
|
This time, the commit goes along with the -a flag, the file will be commited
Alice/> git commit -a -m "foo foo"
[master 7027aab] foo foo
1 file changed, 1 insertion(+), 1 deletion(-)
snap no: 8 | | | |
Alice/> git status
On branch master
nothing to commit, working directory clean
snap no: 9 | | | |