Skip to content

Commit f087736

Browse files
authored
Update git.md
1 parent 222d75c commit f087736

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

git.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
1、
1+
# Git 常用命令
2+
3+
> demo-branch: 演示分支
4+
5+
6+
#### 分支相关
7+
8+
```bash
9+
# 切换分支
10+
git checkout demo-branch
11+
12+
# 创建新分支并切换到该分支
13+
git checkout -b demo-branch
14+
15+
# 删除本地分支
16+
git branch -D demo-branch
17+
18+
# 删除远程分支
19+
1、git push origin -d demo-branch
20+
2、git push origin :demo-branch
21+
22+
# 显示本地分支
23+
git branch
24+
25+
# 显示远程分支
26+
git branch -r
27+
28+
# 显示本地和远程分支
29+
git branch -a
30+
31+
# 显示本地分支关联远程仓库情况
32+
git branch -vv
33+
34+
# 重命名本地分支
35+
git branch -m new-branch
36+
37+
38+
```
39+
#### 拉取远程仓库代码到本地
40+
41+
```bash
42+
# 拉取远程仓库代码到本地当前分支(本地分支已与远程分支关联)
43+
git pull
44+
45+
# 拉取远程仓库代码到本地其它分支
46+
git pull <remote-branch>:<local-branch>
47+
48+
#
49+
```
50+

0 commit comments

Comments
 (0)