侧边栏壁纸
博主头像
Komi博主等级

WizMan Komi

  • 累计撰写 30 篇文章
  • 累计创建 43 个标签
  • 累计收到 3 条评论

目 录CONTENT

文章目录

.gitignore是什么 C# .Net解决方案推荐的.gitignore文件

Komi
2022-04-29 / 0 评论 / 0 点赞 / 166 阅读 / 1,995 字
温馨提示:
内容仅供参考,实际使用需根据自身条件进行调整与删改

什么是gitignore文件

Specifies intentionally untracked files to ignore // 有意指定的那些未被git跟踪的忽略文件

我们在自己创建新的项目的时候 总会生成一些不必要被git识别的文件 这些文件对于寄托在gitlab上是不必要的 而且有时候对于我们需要找到自己想要从本地寄存上推送到远程的文件有一定程度的误导 所以有了gitignore这样的文件

为什么我的gitignore文件有时不被生效?

这是因为目前的文件已被git track到了 因此需要将本地缓存的文件进行假删除

本地缓存删除文件
git rm -r --cached .
添加到本地缓存
git add .
本地提交
git commit -m 'xxx'

C#推荐的gitignore文件

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.svclog
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml
*.azurePubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/
## TODO: If the tool you use requires repositories.config, also uncomment the next line
!packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
![Ss]tyle[Cc]op.targets
~$*
*~
*.dbmdl
*.[Pp]ublish.xml

*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

_NCrunch*

推荐文章:->

https://git-scm.com/docs/gitignore // gitignore官方文档
https://www.toptal.com/developers/gitignore // 自动生成器
0

评论区