Description: this article is talking about some git commands and their meanings
git blame
执行该命令时,会逐行显示文件,并在每一行的行首显示commit号,提交者,最早的提交日期等。
Linux 十位文件权限
1 3 3 3 分别对应类型: 根用户权限,组内用户权限,其他用户权限。
权限类型: 读,写,可执行
- 1,代表文件类型,一般会有三类,-代表普通二进制文件,I代表符号链接文件,d代表目录文件
- 2-4,代表文件所有者的权限表示情况,分别对应可读(r) 可写(w) 可执行(x),- 代表没有该项权限
- 5-7,代表文件所有者所属组的权限表示情况,分别对应可读(r) 可写(w) 可执行(x),- 代表没有该项权限
- 8-10,表示除文件所有者和所属组的其他人所拥有的权限表示情况,分别对应可读(r) 可写(w) 可执行(x),- 代表没有该项权限
linux的返回值
- 0: 成功
- “OS error code 1: Operation not permitted”
- “OS error code 2: No such file or directory”
- “OS error code 3: No such process”
- “OS error code 4: Interrupted system call”
- “OS error code 5: Input/output error”
- “OS error code 6: No such device or address”
- “OS error code 7: Argument list too long”
- “OS error code 8: Exec format error”
- “OS error code 9: Bad file descriptor”
- “OS error code 10: No child processes”
- “OS error code 11: Resource temporarily unavailable”
- “OS error code 12: Cannot allocate memory”
- “OS error code 13: Permission denied”
Git push -u origin master
The -u flage is used to set origin as the upstream remote in your git config, as you push a branch successfully or up to data it, it adds upstream reference.
As you push local branch with git push -u option, the local branch is linked with the remote branch automatically. The advantage is, you may use git pull without any arguments
1 | git pull |
删除行
- ndd: 删除当前行开始的连续n行
- dd:删除光标所在行
- N1,n2d:删除n1到n2行 (删除1到10行:1,10d)
- n,$d: 删除从某行开始至文本末尾(删除第八行到末尾:8,$d)