gpt4 book ai didi

git - 如何查看 git commit id

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

我是 git 的初学者我想知道如何查看 git commit id 我试图通过 git log 查看它,但我认为它没有显示写 ID
原因:我想比较两个提交,它的语法是

Git diff <commit id> <commit id>

最佳答案

查看“Git Basics - Viewing the Commit History”,一个简单的 git log 将显示提交 ID

$ git log
commit ca82a6dff817ec66f44342007202690a93763949 <===
Author: Scott Chacon <schacon@gee-mail.com>
Date: Mon Mar 17 21:52:11 2008 -0700

Change version number

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7 <===
Author: Scott Chacon <schacon@gee-mail.com>
Date: Sat Mar 15 16:40:33 2008 -0700

Remove unnecessary test
从那里,你 can compare your two commits .
git diff <commit_Id_1> <commit_Id_2>

For checking only the changed/added/deleted files:

 git diff <commit_Id_1> <commit_Id_2> --name-only

关于git - 如何查看 git commit id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63146776/

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