For myself using a mac with the latest versions of everything I found that when I used the ‘ignore’ function on SourceTree it didn’t actually create a .gitignore file.
A good way of doing it instead is to head to the github page for the repository and click ‘Create New File’ and just type ‘.gitignore’ in the file path name. A dropdown menu will now appear asking if you want to use a template. I have personally used the UnrealEngine template which has a more comprehensive list of ignores than the one in the tutorial. If this breaks the tutorial of course I will simply revert it back to the format used in this tutorial.