Questions on Git/Vim interactions

This question already has an answer here:

  • How to exit the Vim editor? 10 answers

  • You should press Escape, then enter :cq (that's : (colon), then cq, followed by Enter).

    Now you will have left the vi editor, which is a fine editor, but has a bit of a learning curve.

    Instead, go install GitPad, which will set up notepad as the text editor for Git.

    Then you can run your rebase command again and you should be placed in the familiar notepad editor. (Now, I concede the notepad is a bit of a mediocre editor, but there's no reason to have to learn a decades old Unix text editor while you're trying to learn a merely decade old Unix version control system.) Once notepad opens, follow the instructions that it gives you - in this case, changing the second line from pick to fixup (or perhaps squash ) is probably the right thing.


    You are in the middle of an interactive rebase , and Git has placed you in the Vim editor so you can interactively tell Git the actions to take.

    You should either learn the basics of Vim, or configure Git to use a different editor.

    But for now , basically you want to replace the second "pick" with the text "squash" so the two commits are combined into one.

    Steps:

  • Press Escape to ensure you are in "command mode"
  • Press j to go down to the second line
  • Press xa few times until the "pick" word is removed
  • Press i to enter "insert mode" and type the text "squash"
  • Press Escape to get out of "insert mode" and back to "command mode"
  • Type :wq to exit the Vim editor
  • You have now finished the rebase.

    链接地址: http://www.djcxy.com/p/22582.html

    上一篇: 你怎么能退出并编译一个.am文件

    下一篇: 关于Git / Vim交互的问题