git 中 amend 是什么意思
1
hellohello123 2017 年 8 月 8 日
当前分支?
|
2
FrankFang128 2017 年 8 月 8 日
修复前一个 commit
|
3
yantianqi OP @FrankFang128 提交完后,发现打上 amend 对勾有出现好几个暂存区的更改,要不要提交呢?操作和不操作有什么区别呢?
|
4
beginor 2017 年 8 月 8 日 via Android 我理解为 append, 将工作区的更改添加到上一次 commit,前提上一次 commit 没有 push 到远程服务器
|
5
wenzhoou 2017 年 8 月 8 日 via Android
「 amend 」
動詞 修改 modify, amend, revise, alter 修正 correct, amend, revise 改正 correct, amend, put right 补 make up, supplement, patch, repair, mend, amend 悛 repent, reform, amend 拨正 amend, correct, mend, rectify, remedy, right 这样记忆 i ‘ m end=我完蛋了 |
6
Biwood 2017 年 8 月 8 日
居然不是用命令行,我只知道 git commit 的时候,加上 amend 参数可以用来修改上一次提交的信息
|
7
oaix 2017 年 8 月 8 日
其实就是 git reset HEAD^和 git commit 两条命令的快捷方法
|
8
inflationaaron 2017 年 8 月 9 日
amend 生成的 commit 有一个全新的 hash,所以如果老 commit 已经 push 了就尽量不要用 amend,会给其他 contributer 造成麻烦。
|
9
hantsy 2017 年 8 月 9 日
@FrankFang128 不是。
@Biwood 之前有项目,我们要求 Commit 的 Comments 必须规范。而经常 Commit 是好习惯,但是发现,上次 Commit 有问题,少了文件或者功能上有问题,而新的 Commit 中并包含什么太多的新功能,仅仅是补充上次 Commit,理论上如果两次合并成一次 Commit 更为合理。 所以 amend 的派上用场。新的 Commit,可以重新编辑上次 Comment。 @inflationaaron 对于一些正在开发的新功能(可能是一个任务的 Checklist )没必要一 Commit 对应一个 Push 的,通常我也是多次 Commit (每次 Commit 完成 CheckList 中的一个项目) 再 Push 上去。 |
10
Williamp 2017 年 8 月 9 日
Simply meaning of git is a foolish but in the meaning of change, its meaning is 'disagreeable person'.
|
11
inflationaaron 2017 年 8 月 11 日
@hantsy `git rebase -i` 有这样的作用啊,把多个 commit 合成一个。反正都是 local 的 branch 只要没有别人 checkout,随便怎么搞都行
|