372 lines
14 KiB
Plaintext
372 lines
14 KiB
Plaintext
Microsoft Windows [版本 10.0.26100.2314]
|
||
(c) Microsoft Corporation。保留所有权利。
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>touch README.md
|
||
'touch' 不是内部或外部命令,也不是可运行的程序
|
||
或批处理文件。
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>echo "test" > README.md
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>dir
|
||
驱动器 C 中的卷没有标签。
|
||
卷的序列号是 0E23-B25F
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo 的目录
|
||
|
||
2024/11/29 12:45 <DIR> .
|
||
2024/11/29 12:43 <DIR> ..
|
||
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 .
|
||
git: '.' is not a git command. See 'git --help'.
|
||
|
||
The most similar commands are
|
||
am
|
||
gc
|
||
mv
|
||
p4
|
||
rm
|
||
|
||
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
|
||
fatal: unable to access 'https://demo.gitea.com/lzdev/Demo.git/': TLS connect error: error:00000000:lib(0)::reason(0)
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>git remote add origin https://demo.gitea.com/lzdev/Demo.git
|
||
error: remote origin already exists.
|
||
|
||
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 <path>] [-c <name>=<value>]
|
||
[--exec-path[=<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=<path>]
|
||
[--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
|
||
<command> [<args>]
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>git config --gloabal user.name "lzdev"
|
||
error: unknown option `gloabal'
|
||
usage: git config list [<file-option>] [<display-option>] [--includes]
|
||
or: git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
|
||
or: git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
|
||
or: git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
|
||
or: git config rename-section [<file-option>] <old-name> <new-name>
|
||
or: git config remove-section [<file-option>] <name>
|
||
or: git config edit [<file-option>]
|
||
or: git config [<file-option>] --get-colorbool <name> [<stdout-is-tty>]
|
||
|
||
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 <file>
|
||
use given config file
|
||
--[no-]blob <blob-id> read config from given blob object
|
||
|
||
Action
|
||
--get get value: name [<value-pattern>]
|
||
--get-all get all values: key [<value-pattern>]
|
||
--get-regexp get values for regexp: name-regex [<value-pattern>]
|
||
--get-urlmatch get value specific for the URL: section[.var] URL
|
||
--replace-all replace all matching variables: name value [<value-pattern>]
|
||
--add add a new variable: name value
|
||
--unset remove a variable: name [<value-pattern>]
|
||
--unset-all remove all matches: name [<value-pattern>]
|
||
--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 [<default>]
|
||
--get-colorbool find the color setting: slot [<stdout-is-tty>]
|
||
|
||
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 <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 <value>
|
||
with --get, use default value when missing entry
|
||
--[no-]comment <value>
|
||
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 --gloabal user.name "lzdev"
|
||
error: unknown option `gloabal'
|
||
usage: git config list [<file-option>] [<display-option>] [--includes]
|
||
or: git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
|
||
or: git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
|
||
or: git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
|
||
or: git config rename-section [<file-option>] <old-name> <new-name>
|
||
or: git config remove-section [<file-option>] <name>
|
||
or: git config edit [<file-option>]
|
||
or: git config [<file-option>] --get-colorbool <name> [<stdout-is-tty>]
|
||
|
||
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 <file>
|
||
use given config file
|
||
--[no-]blob <blob-id> read config from given blob object
|
||
|
||
Action
|
||
--get get value: name [<value-pattern>]
|
||
--get-all get all values: key [<value-pattern>]
|
||
--get-regexp get values for regexp: name-regex [<value-pattern>]
|
||
--get-urlmatch get value specific for the URL: section[.var] URL
|
||
--replace-all replace all matching variables: name value [<value-pattern>]
|
||
--add add a new variable: name value
|
||
--unset remove a variable: name [<value-pattern>]
|
||
--unset-all remove all matches: name [<value-pattern>]
|
||
--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 [<default>]
|
||
--get-colorbool find the color setting: slot [<stdout-is-tty>]
|
||
|
||
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 <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 <value>
|
||
with --get, use default value when missing entry
|
||
--[no-]comment <value>
|
||
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 <file>..." to update what will be committed)
|
||
(use "git restore <file>..." 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 <ciozhao@126.com>
|
||
Date: Fri Nov 29 12:57:06 2024 +0800
|
||
|
||
a first change about README.md
|
||
|
||
commit 5ae0a0130741c9015dae69f05c95e5380dd19f17 (origin/main)
|
||
Author: lzdev <ciozhao@126.com>
|
||
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>history
|
||
'history' 不是内部或外部命令,也不是可运行的程序
|
||
或批处理文件。
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>git show
|
||
commit 4c393c2fb05ea7e2fd3b01844d1ceba2ab97fc66 (HEAD -> main)
|
||
Author: lzdev <ciozhao@126.com>
|
||
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 "master"
|
||
error: src refspec master does not match any
|
||
error: failed to push some refs to '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% (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 <ciozhao@126.com>
|
||
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 <file>..." 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
|
||
|
||
C:\Users\Lei Zhao\Desktop\demo>
|
||
|
||
|