Programing

버전 제어를 위해 어떤 Visual C ++ 파일 형식을 커밋해야합니까?

crosscheck 2020. 5. 25. 21:02
반응형

버전 제어를 위해 어떤 Visual C ++ 파일 형식을 커밋해야합니까?


버전 제어를 위해 어떤 Visual Studio \ Visual C ++ 파일 형식을 커밋해야합니까?
내 프로젝트에는 다음과 같은 파일 형식이 있습니다.

aps
cpp
exe
filters
h
ico
idb
ipch
lastbuildstate
lib
log
manifest
obj
pch
pdb
rc
rc2
res
sdf
sln
suo
tlog
txt
user
vcxproj

나는 각각에 대한 짧은 추론을 크게 고맙게 생각합니다. 논란의 여지가있는 경우에는주의하십시오. 완전성을 위해 사소한 파일 형식도 의도적으로 포함하고 있습니다.

편집하다

한편으로는 앞으로 플랫폼 독립적이되고 싶습니다. 반면에 가까운 시일 내에 비슷한 설정을 가진 팀원들과 협력하고 싶습니다. 설정 간의 폴더 호환성은 확실히 옵션이므로 워크 플로우를 용이하게하면 경로를 포함하는 구성 파일이 포함될 수 있습니다.
다시 한 번, 무엇이 무엇인지 설명을 부탁드립니다.


예:

  • cpp : 소스 코드
  • 필터 : 프로젝트 파일
  • h : 소스 코드
  • ico : 자원
  • rc : 리소스 스크립트
  • rc2 : 리소스 스크립트
  • sln : 프로젝트 파일
  • txt : 프로젝트 요소
  • vcxproj : 프로젝트 파일

아니:

  • aps : 마지막 리소스 편집기 상태
  • exe : 빌드 결과
  • idb : 빌드 상태
  • ipch : 빌드 헬퍼
  • lastbuildstate : 빌드 헬퍼
  • lib : 빌드 결과. 타사 가능
  • 로그 : 빌드 로그
  • 매니페스트 : 빌드 도우미 스스로 쓸 수 있습니다.
  • obj : 빌드 헬퍼
  • pch : 빌드 헬퍼
  • pdb : 빌드 결과
  • 입술 : 빌드 도우미
  • sdf : 인텔리전스 dbase
  • suo : 솔루션 사용자 옵션
  • tlog : 빌드 로그
  • 사용자 : 디버그 설정. 하나의 개발자 또는 사용자 정의 디버그 설정 인 경우 유지

Several of these are iffy because they can both be auto-generated and maintained yourself. And there are several more that don't appear in your list. Primarily pay attention to the location of the file. If it is in your solution or project directory then it's highly likely you want to check it in. In the Debug or Release subdirectories then highly unlikely. Build + Clean removes a lot of the noise files. And of course: check-in, rename the project directory, check-out and verify that it builds.


From your list I'd choose those:

cpp
filters
h
ico
manifest
rc
rc2
sln
txt
vcxproj

Generally, you should version all files necessary to build the project. Automatically generated files should not be archived imho.


As suggested by Microsoft, filetypes that should be included in version control:

.mak, .dsp, .c, .rc, .rc2, .ico, .bmp, .txt, .def, .hpj, .bat, .rtf, .odl, .inf, .reg, .cnt, .cpp, .cxx, .h, .hpp, .hxx, .inl, .tpl, .vtp, and .mst...

Filetypes that shouldn't be included in:

.pch, .mdp, .ncb, .clw, .obj, .exe, .aps, .cpl, .awk, .exp, .lib, .idb, .opt, .pdb, .map, .res, .ilk, .scc, .bsc, .sbr, .dll, and .tlb...

But in case using an external tool in exe file or external library then I think it should also be included in version control

INFO: Which Visual C++ Files to Add to Source-Code Control

In addition, this link describes the File Types for Visual C++ Projects in Visual Studio 2017.


If you right click over the project there should be a "Add Solution to Source Control" option in the context menu.

If you use this, only those files that are necessary will be added. All the intermediate and output files will be ignored.


The other answers are excellent; I just thought I'd contribute a useful little tool. Check out the Visual Studio .gitignore template on GitHub. It's a nice actively maintained list of files that are commonly kept out of version control.

And while you're at it, the whole gitignore repository is a very useful resource for all sorts of development from ActionScript to Zend. If you don't use Git, you can still use the gitignore files as a reference.


In general, you should add all files which appear in the Solution Explorer to version control. In addition, you need to include the .sln (solution file) and .vcproj/.vcxproj/.vbproj/.csproj files (project file).

Note that if you have a source control plugin for Visual Studio, such as TFS or AnkhSvn, there is no need to explicitly care about this. Visual Studio knows which files need to be in version control and gives the data to the source control plugin. Only if you use an external tool (ex. TortoiseSVN) do you need to have such a list.


Only the onces that are required for building your target. I think this is just .cpp .h .ico .rc .txt .manifest .rc2

I don't know what sdf, aps, filters, user is, haven't seen them in my C++ builds.

Just look and find out if they contain programmer written code or if they are generated by VS.


Contrary to what was stated in an earlier answer, I would like to point out that it appears to be important to version control the .opt file in order to keep track of user options. See reference below:

https://msdn.microsoft.com/en-us/library/aa278994(v=vs.60).aspx

참고URL : https://stackoverflow.com/questions/3922660/which-visual-c-file-types-should-be-committed-to-version-control

반응형