How can you git add a new file without staging it?

后端 未结 3 1471
轻奢々
轻奢々 2021-02-02 05:46

To use git effectively (and as intended) I make small atomic commits, while I do have longer sessions where I do change not only one thing. Thus, I make heavy use of git a

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 06:29

    You could commit an empty file with that path before making your changes. If you've already written things there, move the file away, make a blank file, commit that, then add -p as normal and git commit --amend so you don't have an "Add blank file" commit.

提交回复
热议问题