gitで3回コミットしました。このような。私はこれら三つのコミット スカッシュしたいgit rebaseを行った後で変更がなくなった
asaurab-3.desktop% git lg
* 931b405 - (HEAD -> saurabh, origin/saurabh) minor fixes (6 minutes ago) <Saurabh Kumar Agarwal>
* 838d366 - adding upload and download functionality (15 minutes ago) <Saurabh Kumar Agarwal>
* 0d62348 - first commit (7 days ago) <Saurabh Kumar Agarwal>
* 4797854 - (origin/mainline, origin/HEAD, mainline) commit (2 weeks ago) <Perforce Administrator>
ので、私はそれが3つのコミットして、窓を開け
git rebase -i HEAD~3
をしました。私はsquash
に3つのすべてのpick
を置き換え、私は、エラーメッセージのすべての私の変化はなくなっている
* 4797854 - (HEAD, origin/mainline, origin/HEAD, mainline) commit (2 weeks ago) <Perforce Administrator>
今
Cannot 'squash' without a previous commit
私git lg
ショーを得た:wq! .
使用してエディタから存在しています。どうすれば元に戻すことができますか?
これはあなたのリベースがまだ完了していないgit status
git status
interactive rebase in progress; onto 4797854
No commands done.
Next commands to do (3 remaining commands):
squash 0d62348 first commit
squash 838d366 adding upload and download functionality
(use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'saurabh' on '4797854'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
恐らく 'git rebase --abort'が理にかなっています。対話型スクリプトが壊れているためにrebaseがエラーになる場合、 '--continue'は大きな違いはありません。 –
はい、明らかに 'git rebase --abort'はリベースを止め、以前の作業ツリーに戻ります。しかし、私はここではエラーではないと思っています。 –
はい@sajibkhan、これは誤りではありません。これは、リベース中の定期的な情報です。私はgit logを見て気にしませんでした。 –