C:\Users\Lei Zhao\Desktop\demo>dir
驱动器 C 中的卷没有标签。
卷的序列号是 0E23-B25F
C:\Users\Lei Zhao\Desktop\demo 的目录
2024/11/29 12:45
.
2024/11/29 12:43 ..
2024/11/29 12:43 39 info.txt
2024/11/29 12:45 9 README.md
2024/11/14 16:35 19,456 家委会竞选申报表.doc
3 个文件 19,504 字节
2 个目录 74,087,919,616 可用字节
C:\Users\Lei Zhao\Desktop\demo>git init
Initialized empty Git repository in C:/Users/Lei Zhao/Desktop/demo/.git/
C:\Users\Lei Zhao\Desktop\demo>git checkout -b main
Switched to a new branch 'main'
C:\Users\Lei Zhao\Desktop\demo>git add .
C:\Users\Lei Zhao\Desktop\demo>git commit -m "my first demo about git on my home pc"
[main (root-commit) 5ae0a01] my first demo about git on my home pc
3 files changed, 2 insertions(+)
create mode 100644 README.md
create mode 100644 info.txt
create mode 100644 "\345\256\266\345\247\224\344\274\232\347\253\236\351\200\211\347\224\263\346\212\245\350\241\250.doc"
C:\Users\Lei Zhao\Desktop\demo>git remote add origin https://demo.gitea.com/lzdev/Demo.git
C:\Users\Lei Zhao\Desktop\demo>git push -u origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 5.06 KiB | 1.69 MiB/s, done.
Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To https://demo.gitea.com/lzdev/Demo.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
C:\Users\Lei Zhao\Desktop\demo>git list
git: 'list' is not a git command. See 'git --help'.
The most similar commands are
bisect
rev-list
C:\Users\Lei Zhao\Desktop\demo>git --state
unknown option: --state
usage: git [-v | --version] [-h | --help] [-C ] [-c =]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
[--no-optional-locks] [--no-advice] [--bare] [--git-dir=]
[--work-tree=] [--namespace=] [--config-env==]
[]
C:\Users\Lei Zhao\Desktop\demo>git config
usage: git config list [] [] [--includes]
or: git config get [] [] [--includes] [--all] [--regexp] [--value=] [--fixed-value] [--default=]
or: git config set [] [--type=] [--all] [--value=] [--fixed-value]
or: git config unset [] [--all] [--value=] [--fixed-value]
or: git config rename-section []
or: git config remove-section []
or: git config edit []
or: git config [] --get-colorbool []
Config file location
--[no-]global use global config file
--[no-]system use system config file
--[no-]local use repository config file
--[no-]worktree use per-worktree config file
-f, --[no-]file
use given config file
--[no-]blob read config from given blob object
Action
--get get value: name []
--get-all get all values: key []
--get-regexp get values for regexp: name-regex []
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value []
--add add a new variable: name value
--unset remove a variable: name []
--unset-all remove all matches: name []
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit open an editor
--get-color find the color configured: slot []
--get-colorbool find the color setting: slot []
Display options
-z, --[no-]null terminate values with NUL byte
--[no-]name-only show variable names only
--[no-]show-origin show origin of config (file, standard input, blob, command line)
--[no-]show-scope show scope of config (worktree, local, global, system, command)
--[no-]show-names show config keys in addition to their values
Type
-t, --[no-]type
value is given this type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--bool-or-str value is --bool or string
--path value is a path (file or directory name)
--expiry-date value is an expiry date
Other
--[no-]default
with --get, use default value when missing entry
--[no-]comment
human-readable comment string (# will be prepended as needed)
--[no-]fixed-value use string equality when comparing values to value pattern
--[no-]includes respect include directives on lookup
C:\Users\Lei Zhao\Desktop\demo>git config --global user.name "lzdev"
C:\Users\Lei Zhao\Desktop\demo>git config --global user.email "ciozhao@126.com"
C:\Users\Lei Zhao\Desktop\demo>git commit -m "a first change about README.md"
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\Lei Zhao\Desktop\demo>git add README.md
C:\Users\Lei Zhao\Desktop\demo>git commit -m "a first change about README.md"
[main 4c393c2] a first change about README.md
1 file changed, 8 insertions(+), 1 deletion(-)
C:\Users\Lei Zhao\Desktop\demo>git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
C:\Users\Lei Zhao\Desktop\demo>git stauts
git: 'stauts' is not a git command. See 'git --help'.
The most similar command is
status
C:\Users\Lei Zhao\Desktop\demo>git log
commit 4c393c2fb05ea7e2fd3b01844d1ceba2ab97fc66 (HEAD -> main)
Author: lzdev
Date: Fri Nov 29 12:57:06 2024 +0800
a first change about README.md
commit 5ae0a0130741c9015dae69f05c95e5380dd19f17 (origin/main)
Author: lzdev
Date: Fri Nov 29 12:46:21 2024 +0800
my first demo about git on my home pc
C:\Users\Lei Zhao\Desktop\demo>git log --pretty=oneline
4c393c2fb05ea7e2fd3b01844d1ceba2ab97fc66 (HEAD -> main) a first change about README.md
5ae0a0130741c9015dae69f05c95e5380dd19f17 (origin/main) my first demo about git on my home pc
C:\Users\Lei Zhao\Desktop\demo>git log --graph --pretty=oneline --abbrev-commit
* 4c393c2 (HEAD -> main) a first change about README.md
* 5ae0a01 (origin/main) my first demo about git on my home pc
C:\Users\Lei Zhao\Desktop\demo>git show
commit 4c393c2fb05ea7e2fd3b01844d1ceba2ab97fc66 (HEAD -> main)
Author: lzdev
Date: Fri Nov 29 12:57:06 2024 +0800
a first change about README.md
diff --git a/README.md b/README.md
index f73693a..4edd251 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,8 @@
-"test"
+### 关于这个项目的说明
+
+作者:Lao Zhao 日期:2024年11月29日
+
+---
+
++ 今天创建了这个账号
++ 准备用来记录日记也不错
\ No newline at end of file
C:\Users\Lei Zhao\Desktop\demo>git push -u origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 490 bytes | 490.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To https://demo.gitea.com/lzdev/Demo.git
5ae0a01..4c393c2 main -> main
branch 'main' set up to track 'origin/main'.
C:\Users\Lei Zhao\Desktop\demo>git add .
C:\Users\Lei Zhao\Desktop\demo>git show
commit 4c393c2fb05ea7e2fd3b01844d1ceba2ab97fc66 (HEAD -> main, origin/main)
Author: lzdev
Date: Fri Nov 29 12:57:06 2024 +0800
a first change about README.md
diff --git a/README.md b/README.md
index f73693a..4edd251 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,8 @@
-"test"
+### 关于这个项目的说明
+
+作者:Lao Zhao 日期:2024年11月29日
+
+---
+
++ 今天创建了这个账号
++ 准备用来记录日记也不错
\ No newline at end of file
C:\Users\Lei Zhao\Desktop\demo>git log --oneline
4c393c2 (HEAD -> main, origin/main) a first change about README.md
5ae0a01 my first demo about git on my home pc
C:\Users\Lei Zhao\Desktop\demo>git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged ..." to unstage)
modified: README.md
deleted: info.txt
C:\Users\Lei Zhao\Desktop\demo>git rm info.txt
fatal: pathspec 'info.txt' did not match any files
C:\Users\Lei Zhao\Desktop\demo>git commit -m "我删除了一个叫info.txt的文件"
[main da56802] 我删除了一个叫info.txt的文件
2 files changed, 4 insertions(+), 3 deletions(-)
delete mode 100644 info.txt
C:\Users\Lei Zhao\Desktop\demo>git push
warning: redirecting to https://demo.gitea.com/lzdev/My_diary/
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 529 bytes | 529.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To https://demo.gitea.com/lzdev/Demo.git
4c393c2..da56802 main -> main