Git配置.gitignore文件忽略被指定的文件上传

作者:農碼一生 时间:2022-09-23 03:00:08 

在项目的根目录下建立一个.gitignore的文件(和.git文件同级)

Git配置.gitignore文件忽略被指定的文件上传

.gitignore文件用记事本打开,输入如下内容:

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

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

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

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

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
project.fragment.lock.json
artifacts/

*_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
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

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

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

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

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

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

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

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# 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
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

上传项目到代码库时,会根据文件中的配置,索引排除对应文件

来源:https://www.cnblogs.com/wml-it/p/15941605.html

标签:Git,配置,.gitignore,文件,忽略,文件,上传
0
投稿

猜你喜欢

  • Python 如何反方向迭代一个序列

    2022-12-07 09:44:19
  • CentOS 7.0如何启动多个MySQL实例教程(mysql-5.7.21)

    2024-01-14 10:56:45
  • Python中使用Tkinter模块创建GUI程序实例

    2023-01-22 09:37:38
  • python中实现k-means聚类算法详解

    2021-07-18 21:42:49
  • Python迭代和迭代器详解

    2023-11-20 08:52:28
  • Go语言基础函数基本用法及示例详解

    2024-05-09 14:57:15
  • 浅析C# web访问mysql数据库-整理归纳总结

    2024-01-12 17:07:42
  • 利用Python操作MongoDB数据库的详细指南

    2024-01-16 13:49:28
  • python实现多线程的方式及多条命令并发执行

    2023-08-09 11:37:20
  • Python文本统计功能之西游记用字统计操作示例

    2023-08-10 00:12:59
  • Python如何使用ConfigParser读取配置文件

    2023-11-03 03:05:30
  • OBJECTPROPERTY与sp_rename更改对象名称的介绍

    2024-01-19 21:47:46
  • Requests库实现数据抓取与处理功能

    2021-09-24 01:44:09
  • 兼容主流浏览器的JS复制内容到剪贴板

    2024-04-30 08:52:57
  • 深入了解python的函数参数

    2023-07-24 08:19:01
  • XML编程实例: ASP+XML打造留言本

    2008-10-25 16:35:00
  • MySQL 复制表的方法

    2024-01-21 02:22:50
  • javascript preload&lazy load

    2023-09-01 06:15:43
  • MySQL索引背后的之使用策略及优化(高性能索引策略)

    2024-01-23 04:21:19
  • 浅谈五大Python Web框架

    2023-12-10 07:33:25
  • asp之家 网络编程 m.aspxhome.com