For every story we use a branch in Git. This works great locally but poses a problem when finalizing a feature as we (currently) only push master to our Test environment (IIS). Note that we are using Git next to TFS as TFS is still our main VCS.

We are using TeamCity to build all our branches. How do you test and review code on a test machine while not polluting the main branch? Create multiple IIS applications for every branch? This could be automated but seems contrived.

To clarify, we need to be able to simultaneously test different versions on our test environment.

To clarify, we need to be able to simultaneously test different versions on our testenvironment.
–
TomJul 26 '13 at 12:39

If you're using both Git and Teamcity, why do you still need TFS? If you're not using TFS for its full Application Lifecycle Management (ALM) suite, and only using it for version control, why not just get rid of it? In my opinion, TFS is a far inferior version control system to Git. For a strong argument against TFS for both ALM and version control, see TFS is destroying your development capacity by Derek Hammer.
–
CupcakeJul 27 '13 at 15:06

Also, this question might be a good fit for Programmers too, since it deals with the software development process.
–
CupcakeJul 27 '13 at 15:13

We need TFS for procedural reasons; the rest of the release process is still modeled with TFS.
–
TomJul 30 '13 at 15:09

In case this is not a viable solution for you, the only alternative I see is to deploy multiple IIS applications. This can be done relatively easily using a tool like WeDeploy, but you have to think about a "clean-up policy" to remove obsolete web applications.

To summarize, I've created several applications in IIS, one for every dev in the team (dev & test) and then 3 slots for test purposes alone.

In teamcity we have the build run every against every branch, but do not deploy automatically anymore. The reasoning is that we allow pulls of our builds but don't force upgrades.

When all dev work on a feature branch is complete we merge into master and then sync immediately with TFS so that our master branch is in sync. This allows us to merge each feature per changeset into the next stage.