I know it depends on the project but i want to learn is there a common practice for typical asp.net core project(such as ignoring node_modules).
There is a github repo whose sole purpose is to stockpile different flavors of .gitignore. Here is a link to the one for Visual Studio, which covers ASP.NET Core.
VisualStudio.gitignore
Click the link and click the Raw button at the top of the file to get the plain text version.
This is similar to Stan's answer, but this one, which is from https://github.com/github, seems a little more current than the one from OmniSharp. In fact, it seems that the one from OmniSharp may just be a copy of the one from https://github.com/github.