What is the fastest way to unstage parts of a new file in git?

前端 未结 4 1846
旧巷少年郎
旧巷少年郎 2021-02-12 10:36

When I want to split up a new file into several commits I can git add -N and then interactively stage lines using git gui. When I make a m

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-12 11:33

    Another easy way to sort this is to cut everything out of the file except for one line that you want in the first commit. Stage it and then add back the rest of the file. From then on you can stage hunks/lines as usual

提交回复
热议问题