update some git cmd

This commit is contained in:
shzhxh 2019-07-25 21:02:47 +08:00
parent 06bbfa6ce8
commit a18d98552d
5 changed files with 48 additions and 7 deletions

View File

@ -5,8 +5,19 @@
#### 语法
```
git branch <--track | --no-track> [-l] [-f] <branchname> [start-point]
git branch <--set-upstream-to=upstream> [branchname] # 指定branchname追踪远程分支upstream
git branch <--unset-upstream> [branchname] # 删除对远程分支的追踪
git branch <-m | -M> [oldbranch] <newbranch> # 移动或重命名分支
git branch <-c | -C> [oldbranch] <newbranch> # 复制分支
git branch <-d | -D> [-r] <branchname>... # 删除分支
# branchname : 要创建或删除的分支名
# start-point: 新分支将要指向的提交点
# oldbranch : 已存在分支的名称,此分支将被重命名
# newbranch : 分支的新名称
```
@ -14,10 +25,17 @@ git branch <-d | -D> [-r] <branchname>... # 删除分支
#### 选项
```
-c, --copy # 复制分支和相关的reflog
-C # 等价于--copy --force强制复制分支
-d, --delete # 删除分支
-D # 等价于--delete --force
-f, --force #
-D # 等价于--delete --force,强制删除分支
-f, --force # 与--track或--no-track联用时表示强制把branchname重置为start-point
-m, --move # 移动或重命名分支
-M # 等价于--move --force
-M # 等价于--move --force强制重命名分支
-t, --track #
--no-track #
-u <upstream>, --set-upstream-to <upstream>
# 将upstream指定为branchname的远程分支。如不指定branchname则将upstream指定为当前分支的远程分支。
--unset-upstream # 删除对远程分支的追踪。如不指定分支则删除当前分支对远程分支的追踪。
```

View File

@ -13,12 +13,24 @@ git push [选项] [<repository> [<refspec>...]]
# <tag> 对于tag来说这相当于 refs/tags/<tag>:ref/tags/<tags>
```
#### 选项
```
-d, --delete # 删除远程仓库的refs。refs可以一个分支也可以是一个标签。
-f, --force #
```
#### 例子
```
# 如果修改了远程仓库,又修改了本地仓库,则提交的时候会出错。如果对远程仓库的修改不重要,则可强制覆盖远程仓库
git push orgin master:master --force
git push -f orgin master:master
# 重命名远程分支。没有直接重命名远程分支的命令,只能采用迂回的办法。
# 1. 删除远程分支
# 2. 本地分支改名
# 3. 把改名后的本地分支推送到远程
```

View File

@ -10,14 +10,13 @@
-H, --si # 以1000的倍数来显示sizes
-k # 相当于--block-size=1K
-m # 相当于--block-size=1M
-T, --print-type # 打印文件系统类型
# SIZE由一个整数和可选的单位组成
# 以1024为倍数的单位K,M,G,T,P,E,Z,Y
# 以1000为倍数的单位KB,MB,...
```
- 用法:
- `df -k`以k为单位显示磁盘占用情况
- `df -m`以m为单位显示磁盘战胜情况

View File

@ -2,3 +2,11 @@
lsblk [options] [devices] # 列出块设备的信息
```
#### 选项
```
-f, --fs # 输出文件系统的信息。相当于"-o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT"
-h, --help # 打印帮助信息。
-o, --output <list> # 依据list打印相关信息。使用--help获取list支持的选项。
```

View File

@ -43,7 +43,11 @@ mklabel # 创建disklabel
mktable # 创建分区表
mkpart # 创建分区
name # 为分区命名
print # 打印指定信息
print [args] # 没有参数则显示当前设备的分区表,可选参数如下:
devices : 显示所有的块设备
free : 显示当前块设备未分配空间的信息
list,all: 显示所有块设备的分区表
NUMBER : 显示NUMBER号分区的详细信息
quit # 退出
rescue # 恢复丢失分区
resizepart # 改变分区大小