Git 中回退有 reset 和 revert,这两个的区别就是是否保留更改记录 假设当前的提交情况是:A <- B <- C <- D <- HEAD,如下图: 当前是 D,希望回退到 A,那我们可以使用 reset 命令,reset 后再看 git log 就会发现:B <- C <- D 宛如没有出现过,这适用于想完全舍弃 A 之后的修改 但是如果我们想保留 B <- C <- D 的修改记录,可能这三个 commit 的功能只是暂时用不到,以后可能还…
When running the git log command, we can pass in options as arguments toformat the data shown for each commit. In this lesson, we show how to use the oneline, decorate, graph, stat, and p options with git log. Show it oneline: git log --oneline git l…
In the last lesson, we learned how to format the git log output; in this lesson we will learn how to filter down to a specific set of commits. By default, git log shows every commit in a repo. We will walk through using a bunch of options to filter o…
本文主要记录了版本的回退,以及工作区,暂存区概念的理解. //开始之前,先回顾上次的内容,修改文件如下,并提交到版本库. Git is a distributed version control system. Git is free software distributed under the GPL. 1.查看版本库的信息 ubuntu@myubuntu:~/joe/learngit$ git log //可以看到,下面有3个版本 commit 71038bf6cbd05ef559549a1…