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

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

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

(0)

相关推荐

  • IDEA配置GIT的详细教程

    注:此方法可用于配置gitlab也可用于配置github 1.在github中创建一个账号:https://github.com/join?source=header-home 2.下载并安装git:https://git-scm.com/downloads 3.安装成功后打开Git Bash,输入下列命令,设置git全局用户名和邮箱 4.在IDEA中设置Git,在File-->Setting->Version Control-->Git-->Path to Git executa

  • Git的配置及文件传输方法图文详解

    首先要下载安装git相关软件,在将git配置到idea中. 1.下载相关插件 2.配置git安装包中的gie.exe路径 3.配置git安装包中的bash.exe路径 4.登录git账户 5.添加git本地仓库 6.配置Git本地仓库路径 7.Java代码上传 先选中要上传的项目如下图操作 8.克隆Java程序 到此这篇关于Git的配置及文件传输方法图文详解的文章就介绍到这了,更多相关git文件传输内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

  • Git配置用户签名方式及原因说明

    目录 1.为什么要创建用户签名 2.为什么要在Git中配置这些信息 3.创建用户签名的方式 4.总结 1.为什么要创建用户签名 作为版本控制系统的客户端,每台客户机对版本库的所有提交操作,都需要注明操作者的身份.所以客户机首先需要进行自我身份的注册,即创建用户.Git要求“用户名和Email"这两样信息是必不可少的. 也就是说再让Git干活之前,必须得做一个最小配置,要把参与项目开发的工作人员的user.name以及user.email进行设置. 配置签名的作用:只是区分不同开发人员的身份. 2

  • git安装及idea配置的详细教程

    下载git安装包 下载地址:https://git-scm.com/downloads 默认下载64位安装包,如果不是64位,可手动选择下载. 安装git 同意协议: 建议使用全英文路径: 默认即可: 后续使用默认配置即可,不再详细记录,配置详情可以参考下面文章(感谢作者): https://blog.csdn.net/sishen47k/article/details/80211002 idea配置git 修改git密码 控制面板 -> 用户帐户 -> 管理Windows凭据,修改凭据里的密

  • 配置Git并从GitHub上克隆项目

    一.配置Git: 1.对于首次安装git的机器,一定要首先进行用户账户信息的配置: git config --global user.name "你的github用户名" git config --global user.email "你的github邮箱地址" 2.右键单击桌面空白处,选择Git Gui Here 3.进去之后,选择左上角的help选项,会出现一个Show SSH Key 4.然后点击“Generate Key”得到秘钥,将其复制到剪切板 5.打开

  • Git配置用户签名方式的拓展示例实现全面讲解

    目录 1.配置Git签名 (1)语法 (2)配置系统用户签名 (3)配置全局用户签名 (4)配置本地用户签名 2.查看三个配置文件的用户签名 (1)语法 (2)查看项目/仓库级别的配置文件信息(local) (3)查看用户/全局级别的配置文件信息(global) (4)查看系统级别的配置文件信息(system) (5)查看当前系统中Git的所有配置信息 3.总结 1.配置Git签名 (1)语法 $ git config 配置文件作用域 user.name '用户名' $ git config 配

  • GitHub配置SSH Key的完整步骤

    目录 步骤 一.设置git的user name和email 二.检查是否存在SSH Key 三.获取SSH Key 四.GitHub添加SSH Key 五.验证和修改 验证原理 总结 https://github.com/xiangshuo1992/preload.gitgit@github.com:xiangshuo1992/preload.git 这两个地址展示的是同一个项目,但是这两个地址之间有什么联系呢? 前者是https url 直接有效网址打开,但是用户每次通过git提交的时候都要输

  • GIT相关-IDEA/ECLIPSE工具配置的教程详解

    GIT安装 访问: https://git-scm.com/downloads ,进入git'下载页面,根据个人操作系统下载对应软件版本,默认下载最新版: 双击安装即可.选择安装目录和安装内容,如果只是单纯的使用,默认即可. 安装TortoiseGit 安装前,确认Git已安装好,否则TortoiseGit是装不上的. 访问 : https://tortoisegit.org/download/,选择对应的操作系统位数软件下载, 双击软件,点击next,默认安装即可 生成秘钥 开始菜单找到git

  • Git下载、安装与环境配置的详细教程

    一.git下载与安装 百度git官网,下载链接,根据自己电脑系统下载相应的安装包, 下载最新版本,点击红框或篮筐处即可 点击下载好的安装包安装这个软件 一直点击next,直到出现install,点击install,安装完成后点击finish: 安装好后在桌面界面点击鼠标右键,会出现如下界面 检查git是否安装OK 键盘Ctrl+r,然后在弹出框中出入cdm,弹出如下界面,输入git,回车 弹出上图所示界面就说明安装成功啦!!! 二.环境配置 1.git安装好去GitHub上注册一个账号,注册好后

  • git克隆远程仓库的指定分支方法(附常用git配置命令)

    一.普通克隆方式: git clone <远程仓库地址> 这种克隆方式默认是克隆master主分支,而且通过命令 git branch --list 能看到克隆后在本地也只有这一个分支,如果再通过新建分支再拉取指定分支,甚至可能还需要解决冲突,太繁琐. 二.克隆远程指定分支 那么,如何快速有效的直接克隆远程指定分支? 只需要一条命令: git clone -b <指定分支名> <远程仓库地址> 会自动在克隆该分支在本地,同样克隆后本地只有这一个分支. 附:常用git配置

  • IDEA中配置操作Git的详细图文教程

    要注意这里git的安装路径不是从官网下载的路径,是在执行文件时自己设置的安装路径,一般都在C盘或D盘的Program Files文件夹中 IDEA中操作Git 创建本地仓库 2. 将文件添加到暂存区 可以看到刚刚添加的文件变成绿色,此时选中的文件被存入到暂存区,下一步需要转移到本地仓库 当提交多个文件的时候需要忽略一些不必要的文件,在项目git_1下创建一个文件 *.class.mtj.tmp/*.jar*.war*.ear*.ziphttp://www.java.com/en/download

随机推荐