Используйте git add -N FILE1 FILE2
или git add --intent-to-add FILE1 FILE2
, чтобы добавить новый файл как неотслеживаемый. Таким образом, вы сможете просмотреть diff файла перед его размещением. Вы также можете просто использовать git diff --cached
для просмотра различий поэтапных изменений перед фиксацией.
Из документации git add
:
-N, --intent-to-add
Record only the fact that the path will be added later. An entry for the path is placed in the index with no
content. This is useful for, among other things, showing the unstaged content of such files with git diff and
committing them with git commit -a.