首页 > 其他分享 >vs 使用git管理bin obj 去除版本控制

vs 使用git管理bin obj 去除版本控制

时间:2024-10-17 11:23:18浏览次数:1  
标签:bin files git xml Visual 版本控制 Studio build DocProject

转自:https://www.cnblogs.com/taidi/p/6095549.html

VS使用Git时,如何忽略不想上传的文件

在.net开发中,有很多文件是不希望上传,加入协助开发中,例如生成在的bin/Debug, bin/Release文件等。

在代码目录下建立.gitignore文件: .gitignore (用记事本另存可以保存这个名字),配置上要忽略的文件或者文件夹,然后提交到git 上就可以了。

如果文件已经被跟踪且被推送到远程,把本地这些文件删除再提交到远端。

或者按照下面方法解决:

  1. rm -rf 文件
  2. git rm -r --cached 要忽略的文件
  3. git add -A (添加所有)
  4. git push origin 分支

但是要让项目中其他协作人员第一次获取运程 .gitignore 文件时,别又把这些文件传上去了。

以下是GitHub已经有了一个官方的为Visual Studio项目订制的一个.gitignore文件,文件原地址

  1 ## Ignore Visual Studio temporary files, build results, and
  2 ## files generated by popular Visual Studio add-ons.
  3 ##
  4 ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
  5  
  6 # User-specific files
  7 *.suo
  8 *.user
  9 *.userosscache
 10 *.sln.docstates
 11 *.vcxproj.filters
 12  
 13 # User-specific files (MonoDevelop/Xamarin Studio)
 14 *.userprefs
 15  
 16 # Build results
 17 [Dd]ebug/
 18 [Dd]ebugPublic/
 19 [Rr]elease/
 20 [Rr]eleases/
 21 x64/
 22 x86/
 23 bld/
 24 [Bb]in/
 25 [Oo]bj/
 26 [Ll]og/
 27  
 28 # Visual Studio 2015 cache/options directory
 29 .vs/
 30 # Uncomment if you have tasks that create the project's static files in wwwroot
 31 #wwwroot/
 32  
 33 # MSTest test Results
 34 [Tt]est[Rr]esult*/
 35 [Bb]uild[Ll]og.*
 36  
 37 # NUNIT
 38 *.VisualState.xml
 39 TestResult.xml
 40  
 41 # Build Results of an ATL Project
 42 [Dd]ebugPS/
 43 [Rr]eleasePS/
 44 dlldata.c
 45  
 46 # .NET Core
 47 project.lock.json
 48 project.fragment.lock.json
 49 artifacts/
 50 **/Properties/launchSettings.json
 51  
 52 *_i.c
 53 *_p.c
 54 *_i.h
 55 *.ilk
 56 *.meta
 57 *.obj
 58 *.pch
 59 *.pdb
 60 *.pgc
 61 *.pgd
 62 *.rsp
 63 *.sbr
 64 *.tlb
 65 *.tli
 66 *.tlh
 67 *.tmp
 68 *.tmp_proj
 69 *.log
 70 *.vspscc
 71 *.vssscc
 72 .builds
 73 *.pidb
 74 *.svclog
 75 *.scc
 76  
 77 # Chutzpah Test files
 78 _Chutzpah*
 79  
 80 # Visual C++ cache files
 81 ipch/
 82 *.aps
 83 *.ncb
 84 *.opendb
 85 *.opensdf
 86 *.sdf
 87 *.cachefile
 88 *.VC.db
 89 *.VC.VC.opendb
 90  
 91 # Visual Studio profiler
 92 *.psess
 93 *.vsp
 94 *.vspx
 95 *.sap
 96  
 97 # TFS 2012 Local Workspace
 98 $tf/
 99  
100 # Guidance Automation Toolkit
101 *.gpState
102  
103 # ReSharper is a .NET coding add-in
104 _ReSharper*/
105 *.[Rr]e[Ss]harper
106 *.DotSettings.user
107  
108 # JustCode is a .NET coding add-in
109 .JustCode
110  
111 # TeamCity is a build add-in
112 _TeamCity*
113  
114 # DotCover is a Code Coverage Tool
115 *.dotCover
116  
117 # Visual Studio code coverage results
118 *.coverage
119 *.coveragexml
120  
121 # NCrunch
122 _NCrunch_*
123 .*crunch*.local.xml
124 nCrunchTemp_*
125  
126 # MightyMoose
127 *.mm.*
128 AutoTest.Net/
129  
130 # Web workbench (sass)
131 .sass-cache/
132  
133 # Installshield output folder
134 [Ee]xpress/
135  
136 # DocProject is a documentation generator add-in
137 DocProject/buildhelp/
138 DocProject/Help/*.HxT
139 DocProject/Help/*.HxC
140 DocProject/Help/*.hhc
141 DocProject/Help/*.hhk
142 DocProject/Help/*.hhp
143 DocProject/Help/Html2
144 DocProject/Help/html
145  
146 # Click-Once directory
147 publish/
148  
149 # Publish Web Output
150 *.[Pp]ublish.xml
151 *.azurePubxml
152 # TODO: Comment the next line if you want to checkin your web deploy settings
153 # but database connection strings (with potential passwords) will be unencrypted
154 *.pubxml
155 *.publishproj
156  
157 # Microsoft Azure Web App publish settings. Comment the next line if you want to
158 # checkin your Azure Web App publish settings, but sensitive information contained
159 # in these scripts will be unencrypted
160 PublishScripts/
161  
162 # NuGet Packages
163 *.nupkg
164 # The packages folder can be ignored because of Package Restore
165 **/packages/*
166 # except build/, which is used as an MSBuild target.
167 !**/packages/build/
168 # Uncomment if necessary however generally it will be regenerated when needed
169 #!**/packages/repositories.config
170 # NuGet v3's project.json files produces more ignoreable files
171 *.nuget.props
172 *.nuget.targets
173  
174 # Microsoft Azure Build Output
175 csx/
176 *.build.csdef
177  
178 # Microsoft Azure Emulator
179 ecf/
180 rcf/
181  
182 # Windows Store app package directories and files
183 AppPackages/
184 BundleArtifacts/
185 Package.StoreAssociation.xml
186 _pkginfo.txt
187  
188 # Visual Studio cache files
189 # files ending in .cache can be ignored
190 *.[Cc]ache
191 # but keep track of directories ending in .cache
192 !*.[Cc]ache/
193  
194 # Others
195 ClientBin/
196 ~$*
197 *~
198 *.dbmdl
199 *.dbproj.schemaview
200 *.jfm
201 *.pfx
202 *.publishsettings
203 node_modules/
204 orleans.codegen.cs
205  
206 # Since there are multiple workflows, uncomment next line to ignore bower_components
207 # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
208 #bower_components/
209  
210 # RIA/Silverlight projects
211 Generated_Code/
212  
213 # Backup & report files from converting an old project file
214 # to a newer Visual Studio version. Backup files are not needed,
215 # because we have git ;-)
216 _UpgradeReport_Files/
217 Backup*/
218 UpgradeLog*.XML
219 UpgradeLog*.htm
220  
221 # SQL Server files
222 *.mdf
223 *.ldf
224  
225 # Business Intelligence projects
226 *.rdl.data
227 *.bim.layout
228 *.bim_*.settings
229  
230 # Microsoft Fakes
231 FakesAssemblies/
232  
233 # GhostDoc plugin setting file
234 *.GhostDoc.xml
235  
236 # Node.js Tools for Visual Studio
237 .ntvs_analysis.dat
238  
239 # Visual Studio 6 build log
240 *.plg
241  
242 # Visual Studio 6 workspace options file
243 *.opt
244  
245 # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
246 *.vbw
247  
248 # Visual Studio LightSwitch build output
249 **/*.HTMLClient/GeneratedArtifacts
250 **/*.DesktopClient/GeneratedArtifacts
251 **/*.DesktopClient/ModelManifest.xml
252 **/*.Server/GeneratedArtifacts
253 **/*.Server/ModelManifest.xml
254 _Pvt_Extensions
255  
256 # Paket dependency manager
257 .paket/paket.exe
258 paket-files/
259  
260 # FAKE - F# Make
261 .fake/
262  
263 # JetBrains Rider
264 .idea/
265 *.sln.iml
266  
267 # CodeRush
268 .cr/
269  
270 # Python Tools for Visual Studio (PTVS)
271 __pycache__/
272 *.pyc
273  
274 # Cake - Uncomment if you are using it
275 # tools/

 

标签:bin,files,git,xml,Visual,版本控制,Studio,build,DocProject
From: https://www.cnblogs.com/gzy2016Blog/p/18471641

相关文章

  • github上最火的大模型教程-免费!
    大型语言模型(LLM)的课程路线图LLM课程分为三个部分:......
  • 常见问题——C#未能找到路径“\bin\roslyn\csc.exe”的一部分
    1.主要原因是因为两个库存在,需要生成一个roslyn文件那么就删除这两个关联的库,就可以达到目的删去项目中的这两天引用:Microsoft.CodeDom.Providers.DotNetCompilerPlatformMicrosoft.Net.Compilers2.删除web.config中加载的这个依赖的代码段<system.codedom><compilers......
  • github pages + hugo 搭建静态博客网站
    体验地址1.起因,目的:其实6年前,我就写过这个。项目代码博客地址最近想改写一下。github推荐的主题是Jekyll,我当时用的就是这个,感觉很麻烦。尤其是文章命名。新的主题hugo用起来还行。2.过程:过程记录,需要详细!因为问题非常多!3.参考教程:视频教程:ht......
  • SciTech-AV-Audio-DAP(Digital Audio Processing)-Loudness Normalization(响度规范化
    LoudnessNormalizationUsetheLoudnessNormalizationtochangetheleveloftheaudio(normallyreduceittorecommendedlimits).ItisbasedonEBUR128recommendationsonlimitingtheloudnessofaudiosignals.SeePerceivedLoudnessforthetechnical......
  • Linux服务器上安装git(运维向)
    (1).参考文献官网在线教程:https://git-scm.com/book/zh/v2官方网站:https://git-scm.com/(2).实验环境2核2GCentOS7.6.1810(3).安装git1)yum或dnf安装[root@VM-0-17-centos~]#dnf-yinstallgit-all2)源码安装安装依赖包[root@VM-0-17-centos~]#dnf......
  • SciTech-AV-Audio-DAP(Digital Audio Processing)-Perceived Loudness(感知响度)-EBU
    PerceivedLoudness(EBUR128)ThespecificationEBUR128/ITU-RBs.1770-4describesanalgorithmforcalculationoftheperceivedloudnessofrealworldaudiosignals,forexamplenopuresinetones.FordetailsoftherecommendationspleaseseeEBUR......
  • git 修改之前提交记录的某几次记录的账号和邮箱
    修改Git提交记录的作者名和邮箱最近在使用Git时,遇到了一个需求:修改某些提交记录中的提交名和邮箱。由于提交时误用了错误的姓名和邮箱,历史记录中的几次提交需要更新。发现使用gitrebase结合gitcommit--amend是一种比较优雅的方式,可以灵活修改历史记录中的提交名和邮箱......
  • jmeter压测问题: JAVA.NET.BINDEXCEPTION: ADDRESS ALREADY IN USE: CONNECT
    1.报错信息:2. 问题排查  1)询问AI,说端口被占用。修改了jmeter的端口号后,仍是不行  2)最后找到一篇博客,真的解决了问题     我只进行了,增大端口号,减少Time_Wait, Close_WAIT没有处理,仍解决了此问题 ......
  • 24K star!告别199韭菜课,来GitHub免费学大模型
    现在的网上充斥着各种AI课程,比如李一舟的199课程。今天推荐一个开源项目,它帮你整理好了大模型学习的roadmap,有资料有代码还免费,它就是:llm-course。llm-course是什么?本项目的内容是一个针对大语言模型的课程,在之前的热点汇总中和大家提过,当时项目内容没有完整,缺了LLM工程......
  • git-pull request
    一、git凭据在使用Git进行版本控制时,凭据主要用于身份验证,以确保用户能够安全地访问和操作代码仓库常见的Git凭据类型:1.用户名和密码最基本的身份验证方式。用户在克隆、推送或拉取时输入其用户名和密码。优点:简单,无需额外配置。缺点:安全性较低,因为密码可以被......