git,如何引用当前分支中的最后提交 [英] git, how to reference last commit in current branch

查看:94
本文介绍了git,如何引用当前分支中的最后提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写代码时,我喜欢在已取得一些进展的阶段进行提交,因为我使用cli作为git,所以我必须使用-m选项一次又一次地输入相同的提交消息。



阅读git文档,其中有-C的提交选项,可以重复使用来自特定提交的消息。

是否有任何简单的方法可以引用上次提交在工作分支?



git commit -C:LastCommit(类似这样的可能吗?)

解决方案

HEAD引用最后一次提交。但老实说,你的问题很奇怪,因为使用最后的提交信息应该是例外......


While writing code i like to commit at stages where some progress has been made, as i use cli for git i have to type same commit message again and again using -m option.

reading git documentation there is -C option for commit which can reuse message from specific commit.

Is there any easy way to refer last commit in working branch?

git commit -C :LastCommit(Something like this possible?)

解决方案

HEAD references the last commit. But honestly your question is strange since using the last commit message should be exceptional...

这篇关于git,如何引用当前分支中的最后提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆