在源项目中 建立了许多虚拟目录,用以分类管理
?
在PULL后,发现,PULL的项目,没有了虚拟目录
?
对比发现:
原项目中有 .vcxproj.user 是用户的一些相关配置
PULL项目中 没有
原因:
1 ,vcxproj就是工程的配置文件,各种库,编译器设置,警告设置
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{F8A53C18-A16D-47FF-9BDE-72AA9F7123A7}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>nls_demo</RootNamespace> <ProjectName>xnw-live</ProjectName> </PropertyGroup>
2,vcxproj.filters 用于项目下文件的虚拟目录 ,筛选器 就是工程下的虚拟文件夹 便于归类文件 浏览试图 提高开发效率
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <ClCompile Include="..\common\httprpc.cxx" /> <ClCompile Include="gui\about\about_form.cpp" /> <ClCompile Include="gui\helper\camera_select.cpp" /> <ClCompile Include="gui\helper\capture_msg.cpp" /> <ClCompile Include="gui\helper\capture_wnd.cpp" /> <ClCompile Include="gui\helper\draw_unit.cpp" /> <ClCompile Include="gui\helper\ui_capture_edit.cpp" /> <ClCompile Include="gui\helper\window_select.cpp" /> <ClCompile Include="gui\toast\toast.cpp" /> <ClCompile Include="gui\tray_icon\tray_icon.cpp" /> <ClCompile Include="main.cpp" /> <ClCompile Include="module\nim_player_cpp_sdk\nim_player_cpp.cpp" /> <ClCompile Include="module\thread\misc_thread.cpp" /> <ClCompile Include="mylavaagnt.cpp" /> <ClCompile Include="stdafx.cpp" /> <ClCompile Include="WndX.cpp" /> <ClCompile Include="xnwpush.cpp" /> <ClCompile Include="gui\courselist\courselist_form.cpp"> <Filter>courselist</Filter> </ClCompile>
3,vcxproj.user 是用户的一些相关配置
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LocalDebuggerWorkingDirectory>..\bin</LocalDebuggerWorkingDirectory> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> </PropertyGroup> <PropertyGroup> <ShowAllFiles>true</ShowAllFiles> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LocalDebuggerWorkingDirectory>$(ProjectDir)..\bin</LocalDebuggerWorkingDirectory> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> </PropertyGroup> </Project>
值得注意的是 只有vcxproj.filters文件可能还是不能完成虚拟目录的显示,必须和vcxproj.user 搭配联合,才能显示出用于管理的虚拟目录
解决方法
在.gitignore中,将 *.user 去除,这样git 的时候就不会忽略各种用户配置了
然后 git status
将 忽略掉的.user文件添加进去
再次PULL的时候,就会发现,新PULL的VS项目中 有虚拟目录了