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

后端 未结 3 1472
轻奢々
轻奢々 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:16

    Maybe you could try writing some pre-commit hook that alerts you if you have untracked files. This will require you to always keep your git directory clean to work, though (and obviously you'll need to keep a up-to-date .gitignore).

    Also try git add -i which is similar to git add -p but also has an interface for adding new files.

提交回复
热议问题