I tried to squash all my commits by running git rebase -i HEAD~n and got blocked somehow. when i run q to exit, i get stuck. @jwnasambu, please help
Oh sorry about this. Run git log
to confirm then number of commits you have then q
to exit.
Run:
git rebase -i HEAD~4
to see a list of commits, each commit starting with the word “pick”.
Then press i
you will then see the word -INSERT- at the bottom left
navigate the letter writer on the screen to the last “Pick” and replace it with ‘f’
then press Esc you will see a blank space at the bottom and type :x
then press enter (I am using --> as pointer don’t type it in, only the commands) then run git push --force
There are 4 commits on that branch. so i run git rebase -i HEAD~4. but still somehow blocked
Just follow the above procedure and share the output. Thanks.
Thanks for the help. Successful
git log -> to know the number of commits
git rebase -i HEAD~n
Press Esc -> creates a blank line where ther’s INSERT at the bottom then
:x
git push --force