gpt4 book ai didi

git - 有没有办法查看提交哈希而不是 HEAD?

转载 作者:行者123 更新时间:2023-12-02 02:18:09 27 4
gpt4 key购买 nike

我遇到了冲突: enter image description here

是否有一个选项可以在 HEAD(绿色下划线)处显示更改的最后一次提交哈希。

我希望这样:HEAD, 476ce2c 简化接口(interface):删除“rs”参数
这将类似于 >>>>>>> 部分

最佳答案

你可以自己就地替换它

find ./ \( -type d -name .git -prune \) -o -type f -print0 | xargs \
sed -i "s/<<<<<<<< HEAD/<<<<<<<< $(git rev-parse --short HEAD)/"

考虑 git log --pretty=reference -n 1 head 作为命令(git rev-parse --short 只是短散列)或引用文档以构建您想要的内容,如 git log --pretty=format:"whatever you like"-n 1 head https://git-scm.com/docs/pretty-formats

find|xargs 从最佳答案修改为 How to do a recursive find/replace of a string with awk or sed?

关于git - 有没有办法查看提交哈希而不是 HEAD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66875169/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com