Skip to content
代码片段 群组 项目
未验证 提交 6515a44b 编辑于 作者: Amy Qualls's avatar Amy Qualls 提交者: GitLab
浏览文件

Merge branch 'pw-reflog-docs-update' into 'master'

Update reference log docs

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145708



Merged-by: default avatarAmy Qualls <aqualls@gitlab.com>
Approved-by: default avatarAmy Qualls <aqualls@gitlab.com>
Co-authored-by: default avatarphillipwells <pwells@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -263,7 +263,23 @@ Add another URL to a remote, so both remotes get updated on each push:
git remote set-url --add <remote_name> <remote_url>
```
## Show the log of reference changes to HEAD
## Display changes to Git references
A Git **reference** is a name that points to a specific commit, or to another reference.
The reference `HEAD` is special. It usually points to a reference which points to the tip
of the current working branch:
```shell
$ git show HEAD
commit ab123c (HEAD -> main, origin/main, origin/HEAD)
```
When a reference is changed in the local repository, Git records the change
in its **reference logs**. You can display the contents of the reference logs
if you need to find the old values of a reference. For example, you might want
to display the changes to `HEAD` in order to undo a change.
To display the list of changes to `HEAD`:
```shell
git reflog
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册