首页 > 其他分享 >Git | tag相关命令

Git | tag相关命令

时间:2024-01-13 14:35:59浏览次数:24  
标签:Git tags -- 命令 tag print git message


语法命令

git tag -h
usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]
                <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--points-at <object>]
                [--format=<format>] [--merged <commit>] [--no-merged <commit>] [<pattern>...]
   or: git tag -v [--format=<format>] <tagname>...

    -l, --list            list tag names
    -n[<n>]               print <n> lines of each tag message
    -d, --delete          delete tags
    -v, --verify          verify tags

Tag creation options
    -a, --annotate        annotated tag, needs a message
    -m, --message <message>
                          tag message
    -F, --file <file>     read message from file
    -e, --edit            force edit of tag message
    -s, --sign            annotated and GPG-signed tag
    --cleanup <mode>      how to strip spaces and #comments from message
    -u, --local-user <key-id>
                          use another key to sign the tag
    -f, --force           replace the tag if exists
    --create-reflog       create a reflog

Tag listing options
    --column[=<style>]    show tag list in columns
    --contains <commit>   print only tags that contain the commit
    --no-contains <commit>
                          print only tags that don't contain the commit
    --merged <commit>     print only tags that are merged
    --no-merged <commit>  print only tags that are not merged
    --sort <key>          field name to sort on
    --points-at <object>  print only tags of the object
    --format <format>     format to use for the output
    --color[=<when>]      respect format colors
    -i, --ignore-case     sorting and filtering are case insensitive

常用命令

创建tag

  1. 创建本地tag
git tag -a <tag_name> <commit_id>
  1. 推送tag到远程
git push --tags origin <remote_branch_name>

删除tag

  1. 删除本地tag
git tag -d <tag_name>
  1. 远程进行删除tag
git push origin :refs/tags/<tag_name>


标签:Git,tags,--,命令,tag,print,git,message
From: https://blog.51cto.com/u_16102572/9232369

相关文章

  • 机器视觉 - YoloV8 命令行安装
    创建python环境下载并安装miniconda安装包,注意miniconda和python版本对应关系,不要选择python最新的版本,以免yolo或pytorch不能兼容最新版python.这里到安装到C:\miniconda3配置conda环境,修改conda配置文件内容,文件名为C:\Users\myuser\.condarcpy虚拟环......
  • windows 命令行调整分辨率
    windows命令行调整分辨率 下载:qres_v1.1https://abcker.lanzouq.com/i1uzA1a5uo8j 解压出来,如:D:\Soft\QRes,不要使用中文名目录。先用命令行查看下本机支持的分辨率。qres.exe/L支持的:1680x1050,[email protected],[email protected],32bits......
  • github 修改hosts DNS解析
    第一步打开在线dns解析github.comhttp://www.ip33.com/dns.html修改hostswindow下首先找到域名文件,一般在C:\Windows\System32\drivers\etc下,然后打开hosts文件,在里面增加一条域名解析记录,修改成功后刷新DNS解析,一般使用ipconfig/flushdns,在命令台输入便可。刷新成功后可......
  • vim模式用法及命令
    vim的安装[root@ycy2023~]#yuminstallvim-y学习vim编辑器vim命令模式(重点)进入命令模式按a,i,o由命令模式进入编辑模式按ESC键就可以退出编辑模式进入命令模式光标移动按a进入是当前光标所在的字符后光标前输入内容,按i进入是当前光标所在字符前输入内容,按o进入......
  • 500mA High Voltage Linear Charger with OVP/OCP
    一、GeneralDescriptionYHM2810isahighlyintegrated,single-cellLi-ionbatterychargerwithsystempowerpathmanagementforspace-limitedportableapplications.ThefullchargerfunctionfeaturesTrickle-charge,constantcurrentfastchargeandconstant......
  • tar命令用法
    tar将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。补充说明tar命令可以为linux的文件和目录创建档案。利用tar,可以为某一特定文件创建档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文件。tar最初被用来在磁带上创建档案,现在,用户可以......
  • 详解如何在Linux(CentOS 7)命令行模式安装VMware Tools
    本例中为在Linux(以CentOS7为例)安装VMwareTools。1.首先启动CentOS7,在VMware中点击上方“VM”,点击“InstallVMwareTools...”(如已安装则显示“ReinstallVMwareTools...”)。2.在命令行输入“ls/dev”查看。3.输入“mkdir/mnt/cdrom”在/mnt目录下新建一个名为cdrom的文件夹......
  • 认识git使用git-01基础认识以及使用
     首先要下载并且安装git下载地址Git(git-scm.com)安装傻瓜式安装目录一.设置用户信息二.为常用指令配置别名编辑三.获取本地仓库1.要使用Git对我们的代码进行版本控制,首先需要获得本地仓库四.基础操作指令1.一次提交的过程编辑2.实现版本回退3.如果在文件夹中又不想提交的文件一.......
  • Ubuntu下压缩、解压常用命令
    .tar文件#仅打包,并非压缩tar-xvfFileName.tar#解包tar-cvfFileName.tarDirName#将DirName和其下所有文件(夹)打包.gz文件#.gzgunzipFileName.gz#解压1gzip-dFileName.gz#解压2gzipFileName#压缩,只能压缩文件.tar.gz文件、.tgz文......
  • 【一文搞定】Linux面试必备20个常用命令
    第一章什么是linux多用户,多任务,支持多线程和多CPU的操作系统,linux的应用领域:免费,稳定,高效的,一般运行在大型服务器上常用目录介绍:[root@localhost~]#的含义:@之前的是当前登录的用户localhost是主机名字~当前所在的位置(所在的目录)~家目录/根目录#的位置是用户标识#是超级用户$普......