Git Reference Logs in 1 minute

Makzan
·
·
IPFS
·
The git reference logs command allows us to refer to where the branch was pointing to. That enables us to rescue the commits that are already missing in the git log.

Hey there, this is Thomas from Macao.

In this video, I would like to talk about the git reference logs.

The Git reference logs command gives us the ability to rescue any removed commits, at least in a short period before we purge the log history. 

For example, if we want to group the latest 3 commits into 1 commit before pushing it to remote, we may perform a soft reset and then create a single commit again. That commit will contain all the changes for those 3 commits. 

But if anything went wrong and we want to revert to the state before we reset, we need the reference of the original 3 commits. 

By using the git reflog command, we can show the original 3 commits and the hash. We can then reset the branch back to the state where we were in.

That’s it for the basic git reference log introduction. In the next video, I will show the date range query for commits and combine it with the git reference log.


CC BY-NC-ND 2.0 授权

喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!

logbook icon
Makzan我管理世界職業技能競賽之網站技術項目、舉辦本地設計與開發賽事、開課分享技術心得。一個用網頁來表達自己的作家。
  • 来自作者
  • 相关推荐

期望與放下

甚麼是世界職業技能競賽

【最後兩天】買《所謂「我不投資」,就是 all in 在法定貨幣》親身體驗擁有 NFT