构建团队库时VC项目环境设置与源码变更提交Git是否均记录?
Answers to Your VC Project & Git Tracking Questions
Hey there! Let me break this down clearly for you since I’ve worked with VC projects and Git tracking quite a bit.
1. Will both source code changes and environment setting changes be recorded when pushing to Git?
Git doesn’t care if a change is in source code or environment settings—it only tracks changes to files that are part of your repository. So:
- If your environment settings are stored in files that aren’t excluded by
.gitignore, their changes will be detected, staged, committed, and pushed just like your.cpp/.hsource files. - If those setting files are listed in
.gitignore, Git will completely ignore any changes to them, and they won’t be included in pushes.
2. When modifying VC project environment settings during team library building, will these changes be recorded on push, or only source code changes?
This depends on which files you modified for the environment settings:
- Tracked files (changes will be recorded): Files like
.vcxproj(team-wide project settings: compiler flags, linked libraries, include paths) and.sln(solution structure) are meant to be shared with your team, so they’re almost always committed to Git. Any changes here will be tracked and pushed just like source code. - Ignored files (changes won’t be recorded): Files like
.vcxproj.userstore user-specific settings (local debug launch paths, personal window layouts) that don’t need to be shared. These are typically added to.gitignore, so Git won’t pick up their changes—they’ll never make it to commits or pushes.
In short: If you tweaked team-focused settings in .vcxproj, those changes will be recorded when you commit and push. If you adjusted user-specific settings, Git won’t track them (and that’s usually the right call for team projects).
内容的提问来源于stack exchange,提问作者exit
相关产品推荐
相关产品推荐

