V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
? Pro Git
? Atlassian Git Tutorial
? Pro Git 简体中文翻译
? GitX
wjx0912
V2EX  ?  git

请教一个 git 指令(根据提交次数找到 commit id)

  •  
  •   wjx0912 · 313 天前 · 745 次点击
    这是一个创建于 313 天前的主题,其中的信息可能已经有所发展或是发生改变。

    腾讯云最新优惠活动来了:云产品限时1折,云服务器低至88元/年 ,点击这里立即抢购:9i0i.cn/qcloud,更有2860元代金券免费领取,付款直接抵现金用,点击这里立即领取:9i0i.cn/qcloudquan

    (福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

    当前分支代码 checkout 后 git rev-list --count main 可以得到 main 分支的 commit 次数。

    这个次数最终编译到 dll 版本号里面,比如 1.0.0.2345

    能不能根据 2345 找到对应的 git 的 commit id

    万分感谢

    wjx0912
        1
    wjx0912  
    OP
       313 天前
    自言自语答复一下:git rev-list main --reverse | nl | grep -w 2345
    retanoj
        2
    retanoj  
       313 天前
    假如我知道了 git rev-list main --reverse 用法,我就会
    git rev-list main --reverse | head -n 2345 | tail -n 1
    wjx0912
        3
    wjx0912  
    OP
       313 天前
    @retanoj good
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   925 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:53 · PVG 05:53 · LAX 14:53 · JFK 17:53
    Developed with CodeLauncher
    ? Do have faith in what you're doing.


    http://www.vxiaotou.com