Which files to add to repository?
習慣了在 UNIX 的 command-line 環境下寫程式,對所有自製或產出的檔案,了若指掌,搭配使用起 version control system,總是能知道哪些該加進 repository。但是,到了 Windows 裡用 Visual C++ 6,產出了一堆奇怪副檔名的檔案,總要傷腦筋哪些檔案應該加進 repository 裡,而哪些不該也不需要。 這個問題以前碰過,但當時似乎是忘了寫 blog 留下筆記,因此搜尋不到。只好再啟用估狗大神,終於找回了這篇文章:《INFO: Which Visual C++ Files to Add to Source-Code Control》。裡面詳列了在使用 Visual C++ 6 時,哪些是應該加進 repository 的,而哪些不需要也不應該。 但今天第二次用 eMbedded Visual C++ 寫程式,上一次因為時間急,所以就亂管一通,這次可不想再隨便來了。因為 eMbedded Visual C++ 產出的檔案,副檔名和 Visual C++ 都不甚相同,只好花了一些時間,再把 eMbedded Visual C++ 的產出檔案,究竟該不該加進 repository,搜尋研究了一番。沒有直接找到如這麼明確的說明文件,最後只有找到這篇《Adding and Removing Files from Projects (Microsoft eMbedded Visual C++ version 3.0)》裡面有個與 Visual C++ 的副檔名功用對應表,勉強可用。 現在作個列表如下,以資記錄:
| 開發工具 | 應該加進 repository 的檔案 | 不應該加進 repository 的檔案 |
|---|---|---|
| Visual C++ 6 | .mak / .dsp / .c / .rc / .rc2 / .ico / .bmp / .txt / .def / .hpj / .bat / .rtf / .odl / .inf / .reg / .cnt / .cpp / .cxx / .h / .hpp / .hxx / .inl / .tpl / .vtp / .mst |
.pch / .mdp / .ncb / .clw / .obj / .exe / .aps / .cpl / .awk / .exp / .lib / .idb / .opt / .pdb / .map / .res / .ilk / .scc / .bsc / .sbr / .dll / .tlb |
| eMbedded Visual C++ 3/4 | .vcw / .vcp / .vcn / .vcc / .vcm |
.htm / .vco |
| Visual Studio 2003~ | .suo / .webinfo / .csproj.user / .vbproj.user / .vcproj.user |
畢竟是沒有官方說明,eMbedded Visual C++ 的列表非常不完全,還有個 .vcb 還不曉得是做什麼用的。只好先放進 repository 等未來發現不需要時再移掉。
2008-02-25 新增:依據《請勿將某些檔案類型的檔案簽入到 Subversion 版本庫》,新增 Visual Studio 2003~ 的部份。



One Comment
請參照《File Types and File Extensions in Visual Studio》以決定 Visual Studio 產生的檔案,哪些該放入 repository 裡。
Post a Comment