V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
andyJado
V2EX  ›  问与答

如何潜入某 commit, 神不知鬼不觉修改, 不影响历史?

  •  
  •   andyJado · 2022-09-19 18:36:52 +08:00 · 1060 次点击
    这是一个创建于 578 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我目前能想到: git checkout <sha>

    - bug
    + new bug
    

    git branch nb

    git rebase ob nb

    但这还是会影响历史的吧

    3 条回复    2022-09-19 18:55:24 +08:00
    villivateur
        1
    villivateur  
       2022-09-19 18:38:54 +08:00
    git 的每一个 commit 都是基于上一个 commit 的,没法做到修改中间某个 commit 而不影响后面的 commit
    Blacate
        2
    Blacate  
       2022-09-19 18:45:16 +08:00 via iPhone
    卧槽 我想到了区块链
    Jirajine
        3
    Jirajine  
       2022-09-19 18:55:24 +08:00   ❤️ 1
    @Blacate 没错,git 的 commit chain 和区块链的连接机制是一样的。
    所以要“篡改”历史,就要篡改所有节点,也就是 git push -f 。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   873 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:48 · PVG 05:48 · LAX 14:48 · JFK 17:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.