我试图从多个提交(它已被推送到起源/主)作出一个提交。GIT rebase - 多个提交到一个 - 仍在历史中看到
我从本教程尝试它: https://feeding.cloud.geek.nz/posts/combining-multiple-commits-into-one/
$ git log --oneline
c172641 Fix second file
24f5ad2 Another file
97c9d7d Add first file
we can combine the last two commits (c172641 and 24f5ad2) by rebasing up to the first commit:
$ git rebase -i 97c9d7d
and specify the following commands in the interactive rebase screen:
pick 24f5ad2 Another file
squash c172641 Fix second file
which will rewrite the history into this:
$ git log --oneline
1a9d5e4 Another file
97c9d7d Add first file
这工作不错,直到我把它推到原点/主。
$ git pull
$ git push origin master
$ git log --oneline
RESULT IS:
******* Merge branch master...
******* THAT REBASE name...
c172641 Fix second file
24f5ad2 Another file
97c9d7d Add first file
但我想这样的结果:
$ git log --oneline
1a9d5e4 Another file
97c9d7d Add first file
这可能吗?
从“一只狗”获取帮助:运行'git log --all --decorate --oneline --graph'。合并后,您可以省略“全部”部分。请记住,*从不使用'git pull' *,首先使用'git fetch',然后使用DOG,*然后*合并*如果* DOG说它没问题。 :-) – torek