我想用VS 2012中的git我面臨一些問題。我沒有更改我的.net Web應用程序的任何文件。我只是運行我的應用程序和VS團隊資源管理器,顯示了很多要提交的文件。我還添加了git ignore和git屬性文件。所以請任何人知道如何忽略運行應用程序(*。dll,* .suo等)後出現的文件。與VS 2012項目文件相關的Git問題
2
A
回答
3
我懷疑你沒有通過Visual Studio UI添加.gitignore和.gitattributes。因此,它們不包含Visual Studio通常添加的所有內容(包括bin,obj,Debug,Release等)。嘗試刪除.gitignore和.gitattributes。然後,在Visual Studio中打開您的解決方案。 Visual Studio必須識別一個Git存儲庫。然後在團隊資源管理器中進入主頁>設置>存儲庫設置。在忽略&屬性文件部分要求Visual Studio生成.gitignore和.gitattributes。如果我是正確的,那應該解決你的問題。
編輯:如果是的.gitignore由Visual Studio自動添加,它通常包含這樣
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# 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
*_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
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# 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 addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# 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 do note that will include unencrypted
## passwords
#*.pubxml
# NuGet Packages Directory
packages/*
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# 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/
# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
自動生成.gitattributes東西:
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
確保您的文件有這樣的信息內。如果他們不這樣做,請複製並粘貼它。
相關問題
- 1. VS 2012項目轉換問題
- 2. VS 2012託管C++項目中的問題目標框架
- 3. 項目目錄結構相關問題
- 4. 與文件輸入相關的問題
- 5. VS 2012 - XP問題
- 6. 與多個TFS項目相關聯的MS項目文件
- 7. 大量文件和dll在我的項目目錄VS 2012
- 8. VS 2012斷點問題
- 9. 擁有不相關目錄中文件的項目的Git存儲庫
- 10. 與@property相關的問題
- 11. 與IndexOutOfRangeException相關的問題
- 12. 與UIButton相關的問題
- 13. 與UITextView相關的問題
- 14. 與NSURLConnection相關的問題
- 15. 與jquery相關的問題
- 16. 與UNUserNotificationSettings相關的問題
- 17. 與JComboBox相關的問題
- 18. 與app_controller相關的問題
- 19. 與GoToStateAction相關的問題
- 20. 與UITabelViewCell相關的問題
- 21. 與errno.h相關的問題
- 22. 與mongodb相關的問題
- 23. 與mysqli_free_results相關的問題
- 24. 與getElementByTagName相關的問題
- 25. 與os.popen相關的問題
- 26. 與errno.h相關的問題
- 27. 與C++相關的問題有問題
- 28. 多模塊maven項目相關性問題與jpa
- 29. VS 2012解決方案和項目 - 與VS 2010不兼容?
- 30. 何處保存與項目相關的文本文件?
$貓 /。gitignore #忽略生成的html文件, #添加要忽略的.gitignore * .ddl或#跟蹤*文件。鎖等 #如果你不想要忽略一個特定的文件使用:!filename.ext –