本文介绍了在Git中执行的命令的历史或日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以跟踪我在Windows下用于Git的命令?我想查看我已应用于存储库的所有命令。



我希望能够重新查看命令历史记录,并找出导致问题的命令。



查看提交历史记录会是一回事,但为了保存其他操作的历史记录,如创建分支或添加远程记录,是否会跟踪这些历史记录?

git会显示影响索引的提交更改,例如 git rm 。它不会存储您执行的所有git命令的日志。



然而,大量的git命令会以某种方式影响索引,如创建一个新的分支。这些更改将显示在提交历史记录中,您可以使用 git log 查看。



然而, git无法跟踪的破坏性更改,比如 git reset

所以,回答你的问题,git不会存储您在存储库中执行的 git 命令的绝对历史记录。但是,通常可以通过提交历史来插入执行的命令。


Is there a way I can keep track of commands I used in Git under Windows? I want to view all the commands that I have applied on my repository.

I want to be able to go back through the command history and figure out the command that caused the problem if one occurred.

Seeing the history of commits would be one thing, but for keeping a history of other actions such as creating a branch or adding a remote, are these tracked?

解决方案

git will show changes in commits that affect the index, such as git rm. It does not store a log of all git commands you execute.

However, a large number of git commands affect the index in some way, such as creating a new branch. These changes will show up in the commit history, which you can view with git log.

However, there are destructive changes that git can't track, such as git reset.

So, to answer your question, git does not store an absolute history of git commands you've executed in a repository. However, it is often possible to interpolate what command you've executed via the commit history.

这篇关于在Git中执行的命令的历史或日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 12:33
查看更多