ZBLOG

git reflog

Git reflog is a command that displays a log of all the Git reference updates made in the repository, including the HEAD and branch positions. It’s useful for recovering lost commits or branches that were accidentally deleted. The output shows the SHA-1 commit hash, the action performed (e.g., checkout, reset), the reference name, and a description of the change.

Here’s an example output from running git reflog:

  1. 4d61b76 (HEAD -> master) HEAD@{0}: commit: Update README
  2. 6a5f29c HEAD@{1}: checkout: moving from feature-branch to master
  3. 2abb8f3 HEAD@{2}: commit: Add new feature
  4. 6a5f29c HEAD@{3}: checkout: moving from master to feature-branch
  5. 4d61b76 (HEAD -> master) HEAD@{4}: commit: Fix bug in user login

This output shows five recent updates to the HEAD position and branch positions in the repository. The most recent update was a commit made on the master branch. Before that, the HEAD was moved from the feature-branch to the master branch with the checkout action. Two more commits were made on the feature-branch before switching back to the master branch again.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=493

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?