ZhangZhihui's Blog  
复制代码
zzh@ZZHPC:/zdata/Github/zzhrepo1$ git add -A
zzh@ZZHPC:/zdata/Github/zzhrepo1$ git commit -m "update function CubeVolume()"
[main 13f27a8] update function CubeVolume()
 1 file changed, 9 insertions(+), 2 deletions(-)
zzh@ZZHPC:/zdata/Github/zzhrepo1$ git tag -a v1.0.1 -m "update function CubeVolume()"
zzh@ZZHPC:/zdata/Github/zzhrepo1$ git push origin main --tags 
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 6 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 650 bytes | 650.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/XXX/zzhrepo1.git
   922a6da..13f27a8  main -> main
 * [new tag]         v1.0.1 -> v1.0.1
复制代码

 

For Git repositories, you can use git ls-remote -t to list all versions, or git ls-remote -h to list all branches in the repository. Alternatively, you can go to the GitHub or GitLab website and view tags or branches.

For example, run this from the command line to list all version releases in gorilla/mux :

$ git ls-remote -t https://github.com/gorilla/mux.git
You will see this output:
0eeaf8392f5b04950925b8a69fe70f110fa7cbfc refs/tags/v1.1

b12896167c61cb7a17ee5f15c2ba0729d78793db refs/tags/v1.2.0

392c28fe23e1c45ddba891b0320b3b5df220beea refs/tags/v1.3.0

bcd8bc72b08df0f70df986b97f95590779502d31 refs/tags/v1.4.0

......

zzh@ZZHPC:/zdata/Github/zimplebank$ git ls-remote -h https://github.com/ZhangZhihuiAAA/zimplebank.git
eba5b8da3864abe6b63d8c762d9ec36f465d683f	refs/heads/main

 

-h, --heads, -t, --tags
Limit to only refs/heads and refs/tags, respectively. These options are not mutually exclusive; when given both, references stored in refs/heads and
refs/tags are displayed. Note that git ls-remote -h used without anything else on the command line gives help, consistent with other git subcommands.

posted on   ZhangZhihuiAAA  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
 
点击右上角即可分享
微信分享提示