IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

git标签管理

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

目录

  • 备注:
  • 知识点
  • 标签
  • Git上打标签
  • 标签的管理

备注:

本文参考于廖雪峰老师的博客Git教程。依照其博客进行学习和记录,感谢其无私分享,也欢迎各位查看原文。

知识点

  • git tag <name>新建一个标签,默认表示的是HEAD,当前提交.
  • git tag v0.9 commit_id在指定提交上创建标签
  • git tag -a <tagname> -m "blablabla..."指定标签信息;
  • git tag -s <tagname> -m "blablabla..."PGP签名标签;
  • 命令git tag查看标签列表。
  • git show <name>显示标签信息
  • 删除标签git tag -d <tagname>
  • 将本地标签推送到远程git push origin <tagname>
  • 一次性推送全部标签到远程git push origin --tags
  • 删除远程标签git push origin :refs/tags/<tagname>

标签

  • 标签类似版本库的一个快照。当发布一个版本时,通常先在版本库中打一个标签(tag),用以唯一确定打标签时刻的版本。
  • 通过获取某个标签的版本,就可以把当时的历史版本取出来
  • Git的标签本质也是指向某个commit的指针,类似于分支,但是标签不能移动,分支可以移动。创建和删除标签都是瞬间完成
  • Git标签方便标识。因为原本的commit是一串数字(6a5819e...),但是tag v1.2就很方便查找和标识

Git上打标签

  • 切换到需要打标签的分支上:
$ git checkout master
切换到分支 'master'
您的分支与上游分支 'origin/master' 一致。

  • 创建标签tag
$ git tag v1.0

  • 查看标签tag历史
$ git tag
v1.0

  • 标签tag默认打在最新提交的commit上。

如果忘了打标签,可以查找历史提交的commit_id,在指定commit_id上打标签

  • 指定commit_id上打标签,如下,在提交merged fixed bug上打新标签

查看commit_id

$ git log --pretty=oneline --abbrev-commit
af1b0b3 add some word on master
faaaaa6 merged fixed bug
afc33ef fixed a bug
0df6e43 Merge branch 'dev'

commit_id上打标签,查看tag历史

$ git tag v0.9 faaaaa6
$ git tag
v0.9
v1.0

  • tag标签是按字母顺序排序的,使用git show <tagname>查看标签信息
$ git show v0.9
commit faaaaa6756a8d04c269b7b5ddccfc2a9e67108db
Merge: 0df6e43 afc33ef
Author: findmoon <1286637198@qq.com>
Date:   Wed Feb 21 22:25:03 2018 +0800
    merged fixed bug

  • 创建带有说明的标签,-a指定标签名,-m指定标签说明
$ git tag -a v0.8 -m"version 0.8 released" 7c4d427

  • git show显示标签说明和信息
$ git show v0.8
tag v0.8
Tagger: findmoon <1286637198@qq.com>
Date:   Thu Feb 22 10:39:40 2018 +0800

version 0.8 released

commit 7c4d4271b7bbd7a9898574ff3cfa795f40f9bbe3
Merge: 8f69de8 44dffc0
Author: findmoon <1286637198@qq.com>
Date:   Wed Feb 21 14:54:46 2018 +0800

    merge with no-ff

  • 使用-s参数,用私钥签名一个标签
$ git tag -s v0.7 -m"version 0.7 released" afc33ef
gpg: 钥匙环‘/home/liu/.gnupg/secring.gpg’已建立
gpg: 钥匙环‘/home/liu/.gnupg/pubring.gpg’已建立
gpg: “findmoon <1286637198@qq.com>”已跳过:私钥不可用
gpg: signing failed: 私钥不可用
error: gpg 无法为数据签名
error: 无法签署标签

因为签名采用PGP签名,所以必须首先安装gpg(GnuPG),没有gpg或者gpgp密钥对,就会报错。

PGP签名的标签是不可伪造的

标签的管理

  • 删除标签git tag -d <tagname>
$ git tag -d v0.8
已删除标签 'v0.8'(曾为 08825cf)

  • 将本地标签推送到远程git push origin <tagname>
$ git push origin v1.0
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:findmoon/newrepo.git
 * [new tag]         v1.0 -> v1.0

  • 一次性推送全部为推送的标签到远程git push origin --tags
$ git push origin --tags
对象计数中: 1, 完成.
写入对象中: 100% (1/1), 164 bytes | 0 bytes/s, 完成.
Total 1 (delta 0), reused 0 (delta 0)
To git@github.com:findmoon/newrepo.git
 * [new tag]         0.8 -> 0.8
 * [new tag]         v0.9 -> v0.9

  • 标签推送到远程后的删除

1、 先删除本地标签

$ git tag -d 0.8
已删除标签 '0.8'(曾为 4dcd55c)

1、 删除远程标签git push origin :refs/tags/<tagname>

$ git push origin :refs/tags/0.8
To git@github.com:findmoon/newrepo.git
 - [deleted]         0.8

文章永久链接:https://tech.souyunku.com/?p=24300


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(80) 打赏



未经允许不得转载:搜云库技术团队 » git标签管理

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367