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

 更新时间:2022年04月28日 08:21:55   作者:農碼一生  
这篇文章介绍了Git配置.gitignore文件忽略被指定文件上传的方法,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

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

.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

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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

相关文章

  • Web端扫码登录的原理和实现讲解

    Web端扫码登录的原理和实现讲解

    这篇文章主要介绍了Web端扫码登录的原理和实现,扫码登录相比较传统的密码登录更加快捷和安全,今天我们就来讲讲原理与实现,主要分为几种不同的解决方案,需要的朋友可以参考下
    2023-03-03
  • VSCode设置默认浏览器打开的两种方式

    VSCode设置默认浏览器打开的两种方式

    在使用vscode编辑器的时候,如果我们不设置默认浏览器,那么直接打开的是IE浏览器,在进行页面调试的时候无疑是有点麻烦的,这篇文章主要给大家介绍了关于VSCode设置默认浏览器打开的两种方式,需要的朋友可以参考下
    2023-09-09
  • 调用无文档说明的 Web API过程描述

    调用无文档说明的 Web API过程描述

    这篇文章主要为大家介绍了调用无文档说明的Web API过程描述,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪<BR>
    2022-03-03
  • 在 WordPress 的页眉(header)和页脚(footer)添加代码方法

    在 WordPress 的页眉(header)和页脚(footer)添加代码方法

    这篇文章主要介绍了在 WordPress 的页眉(header)和页脚(footer)添加代码方法
    2021-09-09
  • scala中停止循环的三种方式(推荐)

    scala中停止循环的三种方式(推荐)

    这篇文章主要介绍了scala中停止循环的三种方式,文中给大家提到了循环语句的流程图,感兴趣的朋友可以参考下
    2019-12-12
  • 关于IDEA git 只有Commit没有Push的问题

    关于IDEA git 只有Commit没有Push的问题

    这篇文章主要介绍了关于IDEA git 只有Commit没有Push的问题,本文给大家介绍的非常想详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2021-01-01
  • Git如何修改已提交的commit注释

    Git如何修改已提交的commit注释

    这篇文章主要介绍了Git如何修改已提交的commit注释问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2023-05-05
  • 滑动窗口算法高效率解决数组问题

    滑动窗口算法高效率解决数组问题

    这篇文章主要为大家介绍了滑动窗口算法高效率解决数组问题详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2023-05-05
  • RocketMQ单结点安装/Dashboard安装过程分享

    RocketMQ单结点安装/Dashboard安装过程分享

    RocketMq属于天生集群,需要同时启动nameServer和Broker进行部署,在通过Dashboard进行监控,本文给大家介绍RocketMQ单结点安装/Dashboard安装过程,感兴趣的朋友跟随小编一起看看吧
    2024-07-07
  • HTTP协议入门_动力节点Java学院整理

    HTTP协议入门_动力节点Java学院整理

    这篇文章主要为大家详细介绍了HTTP协议入门的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-07-07

最新评论