Shw*_*elz 5 git github github-desktop
我正在尝试使用我已经推送到 GitHub 的分支将 6 个提交压缩为单个提交。
我尝试通过命令行执行此操作,但我一直收到 no-op 而不是该分支的提交。
有没有办法通过 GitHub 桌面来做到这一点,这可能更有意义?
如果可能,请逐步提供;
我是将 GitHub 用于协作目的的新手,而且我的知识并没有远远超过 git add、commit 和 push。
有没有一种方法可以通过 GitHub 桌面来做到这一点,可能更有意义?
从版本 2.9 开始,现在有一种方法可以压缩 GitHub Desktop 中的提交。
以下是执行此操作的两种便捷方法。
要进行 git 挤压,请按照下列步骤操作:
// X is the number of commits you wish to squash, in your case 6
git rebase -i HEAD~X
Run Code Online (Sandbox Code Playgroud)
一旦你压缩你的提交 - 选择sfor squash = 它将把所有提交合并到一个提交中。
您还可以使用 --root 标志以备不时之需
尝试:git rebase -i --root
- 根
Rebase all commits reachable from <branch>, instead of limiting them with
an <upstream>.
This allows you to rebase the root commit(s) on a branch.
When used with --onto, it will skip changes already contained in `<newbase>`
(instead of `<upstream>`) whereas without --onto it will operate on every
change. When used together with both --onto and --preserve-merges, all root
commits will be rewritten to have `<newbase>` as parent instead.`
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13717 次 |
| 最近记录: |