Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to ammend a commit comment on a git commit, so I git commit --amend then vi opens with text from the last commit's comment. Then I delete all of the text on the first line, but I cannot remove the newline character, how can I do that?

share|improve this question
up vote 7 down vote accepted

J - Join two lines

share|improve this answer
thanks :j worked! – erikvold Jun 6 '10 at 19:28
@Erik: If it has worked, please click on the tick left to the answer. – whitequark Jun 6 '10 at 19:30
I had to wait 2mins ={ – erikvold Jun 6 '10 at 19:37

You can use dd to delete the whole current line, whether it is empty or not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.