?? string
?? string.c
[jerry @ CentOS project] $ git add string.c
Git is pointing a bookmark question before naming the file. Obviously these files are not part of Git, and that's why Git doesn't know what to do with these files. That's why, Git is pointing a bookmark question before naming the file.
Jerry has added files to the staging area, the git status command will show the files in this area.
[jerry @ CentOS project] $ git status -s
A string.c
?? string
To commit the changes, he uses the git commit command followed by the -m option. If we forget the -m option. Git will open a text editor, where we can write multiple commit information.
[jerry @ CentOS project] $ git commit -m 'Implemented my_strlen function'
The above command will produce the result:
[master cbe1249] Implemented my_strlen function
1 files changed, 24 insertions (+), 0 deletions (-)
create mode 100644 string.c
After committing to view the log details, he ran the git log command. It will display the information of all commits with deposit IDs, depositors, commit dates and SHA-1 hash of deposit.
[jerry @ CentOS project] $ git log
The above command will produce the result:
commit cbe1249b140dad24b2c35b15cc7e26a6f02d2277
Author: Jerry Mouse
Date: Wed Sep 11 08:05:26 2013 +0530
Implemented my_strlen function
commit 19ae20683fc460db7d127cf201a1429523b0e319
Author: Tom Cat
Date: Wed Sep 11 07:32:56 2013 +0530
Initial commit
According to Tutorialspoint
Last lesson: Clone activity in Git
Next article: Review changes in Git