Github 分支拉取和评论

Github Branch Pulling and Commenting

我有一个项目,我想将其分成 3 个实验,每个路径都有一个单独的转折。在路上,我会想恢复到以前的迭代或回到原来的版本。如果我从另一个分支中提取,它会用另一个分支中的文件完全替换我的本地文件吗?要将两个迭代保留在本地,我应该只复制并粘贴文件夹吗?

还有评论,提交新更新的标准做法是什么?每次我提交 -m "new update",它都会替换旧的,我看不到提交的历史记录。

关于查看提交历史的问题,您可以使用:git log 从您的终端在项目的根目录中。 更多信息 here.

来自上面链接的 git-scm 网页:

By default, with no arguments, git log lists the commits made in that repository in reverse chronological order – that is, the most recent commits show up first.

如果您想查看所有差异,可以像这样使用 -p 标志:git log -p.

来自同一网页的一个很好的建议是使用此命令 git log --pretty=format:"%h - %an, %ar : %s" 以非常易读的格式查看日志,例如:

ca82a6d - Scott Chacon, 6 years ago : changed the version number 085bb3b - Scott Chacon, 6 years ago : removed unnecessary test a11bef0 - Scott Chacon, 6 years ago : first commit