I'm using two computers with Visual Studio Ultimate 2012 and the Github extension for it.
There are multiple solutions in the repository.
Sometimes after commiting, the sln, csproj, App.config and AssemblyInfo.cs files are missing in the repository.
I found them with the Git Gui program under "Unstaged Changes" and could add them.
I have to do this every time I add a new solution.
As far as I can see it, the .gitignore file is not responsible for this.
## 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/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# 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
*.Publish.xml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# 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
App_Data/*.mdf
App_Data/*.ldf
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
What is the reason for this behaviour and how can it be fixed?
Edit for additional information:
I'm only working on the master, there are no branches.
I tried it again.
Files untracked were:
$ git status -u
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
007 10001st prime/10001st prime/10001st prime.sln
007 10001st prime/10001st prime/10001st prime/10001st prime.csproj
007 10001st prime/10001st prime/10001st prime/App.config
007 10001st prime/10001st prime/10001st prime/Properties /AssemblyInfo.cs
The files ignored were:
$ git status --ignored
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
007 10001st prime/10001st prime/10001st prime.sln
007 10001st prime/10001st prime/10001st prime/10001st prime.csproj
007 10001st prime/10001st prime/10001st prime/App.config
007 10001st prime/10001st prime/10001st prime/Properties/
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
005 Smallest multiple/Smallest multiple/Smallest multiple/Smallest multiple.v11.suo
005 Smallest multiple/Smallest multiple/Smallest multiple/bin/
005 Smallest multiple/Smallest multiple/Smallest multiple/obj/
006 Sum square difference/Sum square difference/Sum square difference.v11.suo
006 Sum square difference/Sum square difference/Sum square difference/bin/
006 Sum square difference/Sum square difference/Sum square difference/obj/
007 10001st prime/10001st prime/10001st prime.v11.suo
007 10001st prime/10001st prime/10001st prime/bin/
007 10001st prime/10001st prime/10001st prime/obj/
nothing added to commit but untracked files present (use "git add" to track)
It seems that they are not ignored, just untracked.
To really be sure those files are not ignored, double-check (when you see that case again) with
git check-ignore -v -- /path/to/missing/file.sln
That way, you will be sure no .gitignore is responsible.
Make sure you did not just switch from branches (as in this case)
Guy Lowe mentions in the comments:
I had this issue with new .cs files with the line *.user in my gitignore
It was because I had the word user in my folder structure.
Related
I'm using a Visual Studio MSIX packaging project to create an installer on a network share for an internal application.
One problem is that it's creating a directory with "_Test" at the end.
Why is it doing that and how do I get rid of it? I just want "MyApp.MSIX_0.0.1.0", or ideally, "MyApp.0.0.1.0".
Directory of I:\
08/14/2020 09:44 AM <DIR> .
08/14/2020 09:44 AM <DIR> ..
08/14/2020 09:44 AM 21,312 index.html
08/14/2020 09:23 AM 601 MyApp.MSIX.appinstaller
08/14/2020 09:37 AM <DIR> MyApp.MSIX_0.0.1.0_Test
2 File(s) 21,913 bytes
3 Dir(s) 62,444,621,824 bytes free
I've been scouring the documentation, but I can't find anything about the directories it creates or the index.html file it generates. I'd like to customize all that, add release notes, etc.
This is a WPF app, if that makes any difference.
I am just placing here a copy of the original answer from MSFT:
The output directory of the packages is defined in the Microsoft.AppxPackage.Targets file at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage (depending on your version of Visual Studio).
If you want to remove the "_Test" suffix you can modify the lines defining the output directory. In my file it was around line 3190 - 3196:
To modify the output html file, modify the index.template.html file in the "Landing" subdirectory - C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Landing (depending on VS version).
If you are using Azure Pipelines to deploy, you can add parameters to the MSBuild task to do this. For example:
Hardcoded:
task: MSBuild#1
displayName: MSBuild
inputs:
solution: '**/*.sln'
platform: 'x64'
configuration: 'Release'
msbuildArguments: '/p:OutDir=$(Build.BinariesDirectory)/
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/MyApp_1.0.0/"'
or using pipeline variables:
msbuildArguments:
/p:OutDir=$(Build.BinariesDirectory)/
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/$(packageName)_$(newVersion)/"
This gives a folder called "MyApp_1.0.0"
instead of the confusing "MyApp_1.0.0_Test".
And the Uri property inside the .appinstaller file will correctly point to this folder.
For 2022 Professional, the file is: C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppxPackage.Targets
I ran the command tfpt unshelve /migrate /source:$/Dev/MyBranch /target:$/Main from the root project folder containing all branches, taking care to undo all pending changes—both included and excluded—in the source and target branches first. As expected I saw a dialog asking me to select a shelveset, then a rundown of files from the selected shelveset in my VS Developer Command Prompt:
edit: file1.js
edit: file2.js
add: file3.js
add: file4.js
add: file5.html
edit: file6.css
...
The strange thing was that the files merged back into my source branch (Dev\MyBranch) rather than into my target branch (Main). After a tfpt unshelve /undo of the desired shelveset I tried switching the paths for the target and source branches, i.e. tfpt unshelve /migrate /source:$/Main /target:$/Dev/MyBranch but it had the same result. I also tried running the command from \Dev\MyBranch and \Main instead of the root project folder but no matter what I did the shelveset always merged into the dev branch I originally shelved it from. I wasn't able to find any other cases of this issue by searching and I'm not sure what else to try.
From my test in TFS 2015, after running tfpt unshelve /migrate command, the shelvesets will be added to the target path. Please check my command:
I need to remove all files that aren't present in VCS before the build; I've tried setting the "Clean files policy:All untracked files" option, but the binary and zip files created by the previous build remain.
What am I doing wrong?
You can try Build Files Cleaner (Swabra) under Build Features Section. It can help you removing any locking files as well.
I have set my .gitignore to ignore both .sdf files and .vcxproj but they still keep appearing at Git Extensions for me to commit them.
Specifically the *.sdf are causing tons of conflicts as it keeps being updated by vs10, and it prevents me from pulling to my other workstation. Uploading 32mb each time is just not possible.
Here is my .gitignore file:
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.sdf
*.sln
*.suo
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
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/
*.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 database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# 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/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# 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/
*.ipch
ipch/atr tp-e6975b4b/atr tp-ffcb10b7.ipch
ATR TP.sdf
ATR TP/ATR TP.vcxproj
I am sorry if this question was already posted elsewhere, but I searched for a while and couldn't find a suitable answer.
Git Ignore only works on files that haven't already been added to source control already. You'll need to remove them manually and then they will be properly ignored.
How to stop tracking and ignore changes to a file in Git?
As a followup to my question on VS2012, are there any addition that should be made to the .hgignore file for VS2013? Below is the previous answer.
############################################################
## Visual Studio 2012
############################################################
syntax: glob
## User-specific files
*.suo
*.user
*.sln.docstates
## Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
## MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
## Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
## Visual Studio profiler
*.psess
*.vsp
*.vspx
## Guidance Automation Toolkit
*.gpState
## ReSharper Ignores
_ReSharper*/
*.[Rr]e[Ss]harper
## TeamCity Ignores
_TeamCity*
## DotCover Ignores
*.dotCover
## NCrunch Ignores
*.ncrunch*
.*crunch*.local.xml
## Installshield output folder
[Ee]xpress/
## DocProject Ignores
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 Ignores
publish/
## Publish Web Output
*.Publish.xml
*.pubxml
## Windows Azure Build Ignores
csx
*.build.csdef
## Windows Store Ignores
AppPackages/
## RIA/Silverlight projects
Generated_Code/
## SQL Server Ignores
App_Data/*.mdf
App_Data/*.ldf
## Backup & Report Files when converting a solution
## Not required, we have mercurial!
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
## NuGet
packages/
## Miscellaneous Ignores
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
## Windows Ignores
$RECYCLE.BIN/
Thumbs.db
ehthumbs.db
Desktop.ini
By merging the .hgignore I use regularly (with VS 2013 Ultimate) and the .hgignore in your question I compiled the following:
############################################################
## Visual Studio 2013
############################################################
syntax: glob
## User-specific files
*.suo
*.user
*.sln.docstates
## Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
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 Ignores
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
## JustCode
.JustCode
## TeamCity Ignores
_TeamCity*
## DotCover Ignores
*.dotCover
## NCrunch Ignores
_NCrunch_*
*.ncrunch*
.*crunch*.local.xml
## MightyMoose
*.mm.*
AutoTest.Net/
## Web workbench (sass)
.sass-cache/
## Installshield output folder
[Ee]xpress/
## DocProject Ignores
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 Ignores
publish/
## Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
*.pubxml
## Windows Azure Build Ignores
csx/
*.build.csdef
## Windows Store Ignores
AppPackages/
## RIA/Silverlight projects
Generated_Code/
## SQL Server Ignores
App_Data/*.mdf
App_Data/*.ldf
## Backup & Report Files when converting a solution
## Not required, we have mercurial!
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
## NuGet
packages/
## Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
## Microsoft Fakes
FakesAssemblies/
*.favdoc
## Miscellaneous Ignores
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
## Windows Ignores
$RECYCLE.BIN/
Thumbs.db
ehthumbs.db
Desktop.ini
Besides additions for a couple popular plugins (e.g. JustCode and NUnit), it also has additions for BI projects, Fakes etcetera.
You can see all the detailed differences if you just save the listing in your question, save the listing in my answer, and diff the two of course.