Adding new file with diff

Hello, I want to add some new cpp and header files and create a diff for it.
I am using qt creator to create these new files.

I did : git diff > mychanges.diff

Which creates all diffs except newfile modes. So files not found.

What command should I give in terminal or in qt creator to prepare the diff to get newfile mode?

Thanks a lot in advance.

Not sure if it’s the best way, but I generally just add the files, commit to a temp branch and run

git diff master

1 Like

Thanks a lot @LazyDodo ! You have saved my day! :fist_left:

1 Like