$ git status
On branch main
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
markdown_learn.md
nothing added to commit but untracked files present (use "git add" to track)
$ git add markdown_learn.md
$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: markdown_learn.md
$ touch git_learn.md
$ vim git_learn.md
$ cat git_learn.md
# Git Note
# About Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
# Git Commands
`git add <file>`
`git commit -m "<msg>"`
$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: markdown_learn.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
git_learn.md
$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: markdown_learn.md
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: markdown_learn.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
git_learn.md
$ touch .gitignore
$ echo ".DS_Store" >> .gitignore
$ git add .
$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .gitignore
new file: git_learn.md
new file: markdown_learn.md
$ vim git_learn.md
$ cat git_learn.md
# Git Note
# About Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
# Git Commands
`git add <file>`
`git commit -m "<msg>"`
`git status`
$ git add .
$ git commit -m "add new git commands"
[main c874462] add new git commands
1 file changed, 1 insertion(+)
$ git diff bdf79c c87446
diff --git a/git_learn.md b/git_learn.md
index 575b88e..1b60d22 100644
--- a/git_learn.md
+++ b/git_learn.md
@@ -5,3 +5,4 @@ Git is a free and open source distributed version control system designed to han
# Git Commands
`git add <file>`
`git commit -m "<msg>"`
+`git status`