简体   繁体   English

如何查看 git 提交 id

[英]How to see git commit id

I am a beginner in git I want to know how to see git commit id I tried to see it through git log but i think it's not showing write id Reason:I want to compare two commits it's syntax is我是 git 的初学者 我想知道如何查看git 提交 id我试图通过 git 日志查看它,但我认为它没有显示写入 id 的原因是我想比较两个提交的语法:

Git diff <commit id> <commit id>

Looking at " Git Basics - Viewing the Commit History ", a simple git log would show commit ids查看“ 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

From there, you 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

Use利用

git log

or add more parameter或添加更多参数

git log --oneline --decorate --all --graph

Example例子

在此处输入图像描述

Reference: https://git-scm.com/docs/git-log参考: https://git-scm.com/docs/git-log

https://git-scm.com/docs/git-diff#Documentation/git-diff.txt-emgitdiffemltoptionsgtltcommitgt--ltpathgt82308203 https://git-scm.com/docs/git-diff#Documentation/git-diff.txt-emgitdiffemltoptionsgtltcommitgt--ltpathgt82308203

D1CMPS_VYDN+MinhPhuc@D1CMPS_VYDN MINGW64 /e/source_code/github.com/donhuvy
$ ls
angular/                         asterisk-java/                                             odoo/
angular-for-material-design/     Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud/  platform-1/
angular-spring-reactive-sample/  java11/                                                    reactive-spring/
angular-trainning/               ng-book-8sample/                                           storm_websocket/
AspNetCore.Docs/                 ngrx-tutorial/

D1CMPS_VYDN+MinhPhuc@D1CMPS_VYDN MINGW64 /e/source_code/github.com/donhuvy
$ cd AspNetCore.Docs/

D1CMPS_VYDN+MinhPhuc@D1CMPS_VYDN MINGW64 /e/source_code/github.com/donhuvy/AspNetCore.Docs (master)
$ git log --oneline -5
5b8ea167f (HEAD -> master, origin/master, origin/HEAD) Merge remote-tracking branch 'upstream/master'
04ebc1757 Link updates (#15324)
f7a6e54d6 Removed duplicate link to ASP.NET Core Module (#15321)
e39edca55 3.0 update for OAuth overview + google auth + code. (#15245)
bd167a088 Update ui-class.md new project instructions to VS 2019 (#15310)

D1CMPS_VYDN+MinhPhuc@D1CMPS_VYDN MINGW64 /e/source_code/github.com/donhuvy/AspNetCore.Docs (master)
$ git diff 5b8ea167f..e39edca55
diff --git a/aspnetcore/host-and-deploy/iis/development-time-iis-support.md b/aspnetcore/host-and-deploy/iis/development-time-iis-support.md
index 0b7039775..0335b10ef 100644
--- a/aspnetcore/host-and-deploy/iis/development-time-iis-support.md
+++ b/aspnetcore/host-and-deploy/iis/development-time-iis-support.md
@@ -5,7 +5,7 @@ description: Discover support for debugging ASP.NET Core apps when running with
 monikerRange: '>= aspnetcore-2.1'
 ms.author: riande
 ms.custom: mvc
-ms.date: 10/26/2019
+ms.date: 10/10/2019
 uid: host-and-deploy/iis/development-time-iis-support
 ---
 # Development-time IIS support in Visual Studio for ASP.NET Core
@@ -146,6 +146,7 @@ If an untrusted development certificate is used, the browser may require you to
 ## Additional resources

 * [Getting Started with the IIS Manager in IIS](/iis/get-started/getting-started-with-iis/getting-started-with-the-iis-manager-in-iis-7-and-iis-8)
-* <xref:host-and-deploy/iis/index>
-* <xref:host-and-deploy/aspnet-core-module>
-* <xref:security/enforcing-ssl>
+* [Host ASP.NET Core on Windows with IIS](xref:host-and-deploy/iis/index)
+* [Introduction to ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module)
+* [ASP.NET Core Module configuration reference](xref:host-and-deploy/aspnet-core-module)
+* [Enforce HTTPS](xref:security/enforcing-ssl)
diff --git a/aspnetcore/host-and-deploy/iis/index.md b/aspnetcore/host-and-deploy/iis/index.md
index 85136fbdb..9e181a41a 100644
--- a/aspnetcore/host-and-deploy/iis/index.md
:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM