How do I ignore Build_info for git?

I’m using the standard Unity .gitignore file, but I have two problems:
everytime I run the game Unity generates/updates a build_info file and a .csproj file.

I see csproj even is already in the ignore, but yet Visual Studio wants me to push this every time.
What am I doing wrong?

# This .gitignore file should be placed at the root of your Unity project directory
# Get latest from
    # MemoryCaptures can get excessive in size.
    # They also could contain extremely sensitive data
    # Asset meta data should only be ignored when the corresponding asset is also ignored
    # Uncomment this line if you wish to ignore the asset store tools plugin
    # /[Aa]ssets/AssetStoreTools*
    # Autogenerated Jetbrains Rider plugin
    # Visual Studio cache directory
    # Gradle cache directory
    # Autogenerated VS/MD/Consulo solution and project files
    # Unity3D generated meta files
    # Unity3D generated file on crash reports
    # Builds
    # Crashlytics generated file
    # Ignore buildinfo file

For the last two lines which contain the build_info file, I tried both with and without .txt.
The info I found on Google was to include .txt (which doesn't work) so I also tried without because Windows Explorer doesn't show the extension. (also without luck)

I was suggested to right click -> ignore the file in Visual Studio in the Team Explorer tab before pushing. But this ignore option is not available for this file. (it is if I try it on a .png)

Any suggestions?

If are use windows and instaling tortoise git, you can right click on the file > tortoisegit> add to ignore list/ delete and add to ignore list > [namefile]

If you just want to add ignore list with edit .gitignore, you can do this.


or do this to ignore all data in StreamingAssets :


Hope it helps.