简体   繁体   中英

Team Foundation Server - keeping development versions of files seperate from production

We are using Team Foundation Server and have some files being developed that we want under version control. We don't want these files being accidentally pushed into production. We plan on deploying them but right now they would break the web application. What is the best (simplest) way to version these files while avoiding the chance of them being accidentally deployed?

Limit who has privileges to deploy to production.

Putting files in TFS for version control won't deploy them to production. Only somebody with permissions in your production environment can deploy to prod.

What it sounds like you're saying is you have one version of code that you want to push to production, and another copy of the code with changes that you don't want to push to production yet (if you only had one version of the code, then you simply don't deploy until ready and problem solved)

If that is the case, then what you need is branches. You have a branch for each separate version of the codebase that you are working on concurrently. This can get complicated, because you have many options for how to structure your branching strategy, that can have significant implications on your development workflow. See the TFS Rangers Branching Guidance for more info.

The simplest branching structure if you only have the two versions of your codebase, would be a trunk/MAIN branch, then a DEV branch off of that. Trunk/MAIN is what you push to production, DEV is where you do your development work. And only merge into MAIN when you are ready to publish the changes to production.

The easy way is to shelve the changes. However, next best way (I would recommend) is to do the following:

  1. Create STG Branch (This branch is where you would keep the production ready code or "in testing" code.)
  2. Merge current code base to the STG branch.
  3. Create PROD Branch (This branch is used to your currently in production code. (Easy to pull what is in production.
  4. Merge STG branch with PROD when you are ready to push to production.

Keep the base code branch as your "trunk" branch and that is where the code gets kept that is 100% development and never gets into production by accident. (Check in early and often.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM