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

wes wes     2022-08-14     741

关键词:

在.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文件,文件原地址

 

 

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

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

# 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

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_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

# Visual Studio code coverage results
*.coverage
*.coveragexml

# 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
*.jfm
*.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 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# 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

# Cake - Uncomment if you are using it
# tools/

  

vs.net2013中使用git建立源代码管理版本管理

第一次在VS2013中使用Git,也是第一次使用Git,各种不熟悉。百度各种使用经验,大都不屑于使用VS2013集成的Git,建议下载这个下载那个,我也照学了,确实能实现项目的提交、同步、合并的工作,但都不能与VS2013实现无缝配合,... 查看详情

学习使用git版本控制代码管理(代码片段)

Git版本控制学习教程Git版本控制器,可以作为程序员、计算机科学和软件工程的研究人员在编写代码、工程开发过程中的文件管理和代码管理的工具。在基本的GitBash和GitGUI之外,有很多在MacOS、Linux和Windows下的Git管理工具以可视... 查看详情

vs2015去除git源代码绑定

第一次碰到这个问题,想将源代码签入TFS管理。添加到源码管理后,默认添加到Git源码管理。研究过后,发现:1)删除框内文件 2)Vs2015->工具->选项->源代码管理->插件管理 详见下图 注意事项:1)图一两文... 查看详情

git版本控制工具的使用

目录git版本管理工具使用一丶Git的下载与安装1.windows下的git的下载与安装2.linux下的git安装二丶常用命令三丶Git仓库1.配置仓库信息2.仓库的创建于管理四丶远程仓库五丶分支管理六丶标签管理git版本管理工具使用一丶Git的下载与... 查看详情

visualstudio(vs2017)提交代码到git服务器流程(gitcode)

...系统,可以有效、高速地处理从很小到非常大的项目版本管理。有了Git之后团队协作,版本控制都非常方便。场景:(1)版本管理。Git提供了版本管理的功能。可以很方便的上传当前项目到服务器,如果本地代码修改错误,想... 查看详情

使用git管理代码版本(代码片段)

使用Git管理代码版本使用Git管理代码版本本项目使用git管理项目代码,代码库放在gitee码云平台,(注意,公司中通常放在gitlab私有服务器中)为什么要进行源代码管理?方便多人协同开发,防止代码冲突,相互覆盖方便版本控制... 查看详情

版本管理-git使用入门

Git是一个分布式的版本管理系统,而SVN是一个集中式管理系统。版本控制Git简介命令行操作Git图形化界面操作Gitlab服务器环境搭建 查看详情

git(代码片段)

...,创建一个空目录,作为Git仓库    *初始化一个仓库,使用gitinit命令2.添加文件到Git仓库  (1)分两步操作:    1)使用命令gitadd<file 查看详情

使用git分布式版本控制系统

 GIT(分布式版本控制系统)  Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。   Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理... 查看详情

git使用

GIT(分布式版本控制系统)1.简介Git是一款免费/开源的分布式版本控制系统,用于敏捷高效地处理任何或大或小的项目。2.集中式vs分布式  集中式需要联网状态,网速会受限制;而分布式则不需要。  Git拥有强大... 查看详情

git的基本使用

...态很能够保存文件的是否被删除是否有新增文件git的基本使用git的配置命令,这个命令只需要在一台电脑上执行一次gitconfig–globaluser.namepangitconfig–globaluser.emailpanming@itcast.cngitinitgitinit命令,是将当前所在的文件夹,用git版本控... 查看详情

git简单使用(代码片段)

Git简单使用版本控制版本控制概念?版本控制是一种在开发的过程中用于管理我们对文件、目录或工程等内容的修改历史,方便查看更改历史记录,备份以便恢复以前的版本的软件工程技术。?简单说就是用于管理多人协同开发项... 查看详情

git的使用

...等)。Git下载安装下载Git,官网地址:https://git-scm.com/选择使用命令行环境,选择第二个选项,点击“Next”Git本身完全可以做到版本控制,但其所有内容以及版本记录只能保存在本机,如果想要将文件内容以及版本记录同时... 查看详情

git使用方法

一个分布式版本控制系统,和SVN类似,但远比SVN强大的一个版本控制系统①Git可以方便的在本地进行版本管理,如同你本地有一个版本管理服务器一样我们可以选择在合适的时间将本地版本推送到统一的版本管理服务器②Git每次... 查看详情

git使用

一:简介Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。Git是LinusTorvalds为了帮助管理Linux内核开发而开发的一个开放源码的版本控制软件Git也是目前最流行的分布式版本控... 查看详情

git使用

一:简介Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。Git是LinusTorvalds为了帮助管理Linux内核开发而开发的一个开放源码的版本控制软件Git也是目前最流行的分布式版本控... 查看详情

visualstudio(vs2017)提交代码到git服务器流程(gitcode)(代码片段)

...,可以有效、高速地处理从很小到非常大的项目版本管理。有了Git之后团队协作,版本控制都非常方便。场景:(1)版本管理。Git提供了版本管理的功能。可以很方便的上传当前项目到服务器,如果本地... 查看详情

git使用教程(代码片段)

git使用教程前言工欲善其事,必先利其器。作为一名程序员,版本控制工具是必做掌握的一个基本工具,最常用的版本控制工具有svn和git。相对于svn,git的分布式控制、分支特性、灵活性等特点,使得越来越多的项目管理采用git... 查看详情