相关疑难解决方法(0)

git rebase -i 在 rebase 和强制推送后显示错误的提交历史记录

在将一个分支重新建立到另一个分支上后,我遇到了一个有趣的问题;git rebase -i HEAD~n不仅显示错误的提交历史记录(旧分支),还显示错误的提交数量。

我想做的事

我希望能够对git rebase -i HEAD~n正确的提交历史记录进行操作,以便压缩我基于分支的旧分支的剩余提交。

我做了什么导致了这个问题

# On another Feature branch
git branch -b NewFeautureBranch
# Develop my commit
git add editedfile.extension
git commit -m "Commit message"
# I squashed and merged the feature branch into the development branch, as well as some other feature branches
git fetch --all
git checkout DevelopmentBranch
git pull
git checkout NewFeatureBranch
git rebase DevelopmentBranch
git push -f
Run Code Online (Sandbox Code Playgroud)

运行git loggitk会显示应有的历史记录,这是我当前的提交和它最初基于的功能分支的较旧提交,如预期的那样。然而,如果我随后运行,git rebase -i …

git command-line git-rebase windows-10

5
推荐指数
1
解决办法
7247
查看次数

标签 统计

command-line ×1

git ×1

git-rebase ×1

windows-10 ×1