-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (94 loc) · 3.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>git Demo</title>
</head>
<body>
git clone [email protected]:synctimes163/git-demo.git
github 设置中去配置公钥:
1==>ssh-keygen -t rsa -C "[email protected]" ,
2==>cat ~/.ssh/id_rsa.pub
git status 查看状态
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 checkout -- <file>..." to discard changes in working directory)
modified: index.html
no changes added to commit (use "git add" and/or "git commit -a")
git diff 对比修改
diff --git a/index.html b/index.html
index 05193a1..b879794 100644
--- a/index.htmls
+++ b/index.html
@@ -7,6 +7,23 @@
git add .\index.html 添加测试的文件
git commit -m "新增命令提示指示" 提交文件并写入更新提交备注 (新增命令提示指示)
[main 93323fb] 新增命令提示指示
1 file changed, 18 insertions(+), 1 deletion(-)
git push 推送本地git更新到远程仓库,提交成功后,刷新GitHub 操作界面查看更新文件
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), 834 bytes | 417.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To github.com:synctimes163/git-demo.git
7934bac..93323fb main -> main
git checkout -b feature-login
git branch
* feature-login
main
feature-login
* main
master
PS F:\synctimes-gitee\git-github\git-demo> git checkout main
error: Your local changes to the following files would be overwritten by checkout:
Please commit your changes or stash them before you switch branches.
Aborting
PS F:\synctimes-gitee\git-github\git-demo> git checkout main
error: Your local changes to the following files would be overwritten by checkout:
README.md
Please commit your changes or stash them before you switch branches.
Aborting
PS F:\synctimes-gitee\git-github\git-demo> git add .
PS F:\synctimes-gitee\git-github\git-demo> git commit "分支描述"
PS F:\synctimes-gitee\git-github\git-demo> git commit -m "分支描述"
[master 0a15120] 分支描述
1 file changed, 22 insertions(+)
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), 675 bytes | 675.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To github.com:synctimes163/git-demo.git
d6ce7e5..0a15120 master -> master
PS F:\synctimes-gitee\git-github\git-demo> git checkout main
Switched to branch 'main'
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
PS F:\synctimes-gitee\git-github\git-demo> git branch
feature-login
* main
master
-------------------------
以下命令将本地的 master 分支推送到 origin 主机的 master 分支。
$ git push origin master
相等于:
$ git push origin master:master
git push origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.16 KiB | 592.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To github.com:synctimes163/git-demo.git
ccd9175..163ae9d main -> main
</body>
</html>