如何反映GitHub的审查结果

如何反映GitHub的审查结果,git,github,Git,Github,通常,我(=贡献者)应该在推送GitHub上的评论中指出并由我修复的代码之前合并两个提交吗 $ git commit -am "Reflect the result of review" $ git rebase -i HEAD~2 ・・・merge two commits and delete the above commit message by squash option $ git push -f origin [branch for this pull request] 换句话说,需

通常,我(=贡献者)应该在推送GitHub上的评论中指出并由我修复的代码之前合并两个提交吗

$ git commit -am "Reflect the result of review"
$ git rebase -i HEAD~2
・・・merge two commits and delete the above commit message by squash option
$ git push -f origin [branch for this pull request]
换句话说,需要第二步(
git-rebase…


编辑:为了避免误解,我在上面添加了“(=contributor)”。所以,在这个问题上,“我”是指贡献者,而不是审阅者。

你的意思是,将x个修订压缩为一个修订?这是一种可能性。。。。但我更喜欢这样做:

git reset --soft HEAD~2 # take branch pointer two revisions back... it can be n changes, all changes are saved into the index ready to be committed
git commit -m "My feature"

然后你可以按你认为应该使用的分支进行推送。

< P>你是说,把X个修正号压缩成一个?这是一种可能性。。。。但我更喜欢这样做:

git reset --soft HEAD~2 # take branch pointer two revisions back... it can be n changes, all changes are saved into the index ready to be committed
git commit -m "My feature"

然后你可以推你想做的任何事情。

我会说,一般来说,不,你不应该这样做,因为你似乎正在改写一个分支的历史,这个分支可能会与其他开发者分享。只有当您确定没有其他人签出此分支并打算为其作出贡献时,才应该使用此选项。我想说,一般来说,不,您不应该这样做,因为您似乎正在重写可能与其他开发人员共享的分支的历史记录。只有当您确定没有其他人签出此分支并打算对其作出贡献时,才应使用此选项。您可能希望对重写已发布Git分支的历史记录可能产生的副作用进行评论。OP正在运行
Git rebase-i
。。。所以这是同样的罪。没有意义。您可能想对重写已发布Git分支的历史记录可能产生的副作用发表评论。OP正在运行
Git-rebase-i
。。。所以这是同样的罪。没有意义。