This commit is contained in:
Mhrooz 2024-09-02 00:09:29 +02:00
parent 8c6aed4ca1
commit fb0dd4d613

59
notes/3.3-git_touch.md Normal file
View File

@ -0,0 +1,59 @@
## 3.3 git 里程碑
### 3.3.1 显示里程碑
```bash
git tag # 显示里程碑
git tag -n1 # 显示1行里程碑的说明
git tag -l jx/v2* # 使用过滤器
```
```bash
git log --oneline --decorate # 查看提交对应的里程碑以及其他引用
```
```bash
git describe # 显示<tag>-<num-g<commit> <tag> name <num> commit num <commit> commit
```
```bash
git name-rev HEAD # 显示提交ID和其对应的一个引用 这里是HEAD和master
```
### 3.3.2 创建里程碑
```bash
git tag <tagname> [<commit>] # 轻量级里程碑
git tag -a <tagname> [<commit>]
git tag -m <msg> <tagname> [<commit>] # 带说明的里程碑
git tag -s <tagname> [<commit>]
git tag -u <key-id> <tagname> [<commit>] # 带GPG签名的里程碑
```
### 3.3.3 删除里程碑
```bash
git tag -d
```
### 3.3.4 不要更改里程
### 3.3.5 共享里程碑
```bash
git ls-remote origin my* # 查看以my开头的里程碑
```
```bash
git push origin mytag # 推送mytag到远端
git push origin refs/tags/* # 推送本地建立的所有里程碑
```
### 3.3.6 删除远端里程碑
```bash
git tag -d <tagname>
git push origin :<tagname>
```