我通过网站对我的GitHub存储库中的文件进行了一些编辑,然后提交了更改。它不像更改文件,提交然后将其推送到原点,我直接通过访问网站来完成。现在该分支中有两个提交。我可以从终端压缩最后一次提交吗?如果没有,有什么办法可以从GitHub网站上压缩它吗?
我不是英语母语人士。所以,原谅我糟糕的英语。
答案 0 :(得分:2)
我认为你不能从网站上做到这一点。但是你可以从终端做到。
# Pull in the remote changes
$ git pull
# Rebase the last 2 commits interactively
$ git rebase -i HEAD~2
pick abcdef commit to keep
squash 123456 commit to squash
# Override the remote branch
$ git push -f origin <branch>