Git学习

这两个视频和笔记可以初步学习Git

https://mp.weixin.qq.com/s/Bf7uVhGiu47uOELjmC5uXQ

https://www.bilibili.com/video/BV1FE411P7B3?p=14

一些重点笔记截图

image-20210114145445085

image-20210114163626096

image-20210114165739470

image-20210114165706238

image-20210114165914420

git clone [url] # https://gitee.com/kuangstudy/openclass.git

image-20210114171846545

1
2
3
4
5
6
7
8
#查看指定文件状态
git status [filename]

#查看所有文件状态
git status

# git add . 添加所有文件到暂存区
# git commit -m "消息内容" 提交暂存区中的内容到本地仓库 -m 提交信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# 列出所有本地分支
git branch

# 列出所有远程分支
git branch -r

# 新建一个分支,但依然停留在当前分支
git branch [branch-name]

# (新建)一个分支,并切换到该分支
git checkout -b [branch]

# 合并指定分支到当前分支
$ git merge [branch]

# 删除分支
$ git branch -d [branch-name]

# 删除远程分支
$ git push origin --delete [branch-name]
$ git branch -dr [remote/branch]