git hunk edit mode - how to remove a '-' line?

前端 未结 2 734
遥遥无期
遥遥无期 2021-01-31 07:19
+ bbb
- aaa

# ---
# To remove \'-\' lines, make them \' \' lines (context).
# To remove \'+\' lines, delete them.
# Lines starting with # will be removed.
#
# If the pa         


        
相关标签:
2条回答
  • 2021-01-31 07:31

    make them ' ' lines means you need to replace the - in front of the line with a (space).

    0 讨论(0)
  • 2021-01-31 07:47

    A hunk like this:

    + bbb <-- line added
    - aaa <-- line deleted
      ccc <-- line unchanged
    

    will turn into content like this:

    bbb
    ccc
    

    To keep a line marked for deletion (prefixed with '-'), turn it into a line with the same prefix as the unchanged line above (so it will stay the same):

    + bbb
      aaa
      ccc
    

    When the hunk is applied, the contents will look like this:

    bbb
    aaa
    ccc
    
    0 讨论(0)
提交回复
热议问题