Stop Teamcity showing deleted branches

We’re using TeamCity, and I’ve set up jobs to pull from branches. But when those branches are deleted they still appear in Teamcity:

List of outdated branches, only refs/master is active

  • Git commands that you like / cant live without
  • Git: How to be sure untracked config files aren't silently deleted
  • TeamCity: How to put unversioned configuration files in a checked-out repository?
  • What is $(prefix) on $(prefix)/etc/gitconfig?
  • SVN for Emacs: how do you set author name and save password?
  • Build project imported from Eclipse git as Android Project
  • (List of outdated branches, but only refs/master is actually active)

    The Teamcity documentation actually specifies what constitutes an active branch:

    Active branches

    In a build configuration with configured branches, the
    Overview page shows active branches.

    A number of parameters define whether a branch is active. The
    parameters can be changed either in a build configuration (this will
    affect one build configuration only), project, or in the internal
    properties (this defines defaults for the entire server). A parameter
    in the configuration overrides a parameter in the internal properties.

    A branch is considered active if:

    • it is present in the VCS repository and has recent commits (i.e.
      commits with the age less than the value of
      teamcity.activeVcsBranch.age.days parameter, 7 days by default).
    • or it has recent builds (i.e. builds with the age less than the value of
      teamcity.activeBuildBranch.age.hours parameter, 24 hours by default).
    • ! A closed VCS branch with builds will still be displayed as active
      during 24 hours after last build. To remove closed branches from
      display, set teamcity.activeBuildBranch.age.hours=0.

    But… I don’t understand their description! 🙂 What do they mean with “parameters in the configuration”? I’ve tried making parameters in my jobs like so:

    Adding parameter teamcity.activeBuildBranch.age.hours

    (Adding parameter teamcity.activeBuildBranch.age.hours)

    But that doesn’t do anything. Maybe I’m exposing myself as a total TC noob, but can anyone guide me through how to correctly alter these settings so I only show repository-active branches in my build jobs?

  • Setting up SSH keys for github private repo access on Elastic Beanstalk
  • Git Development vs Release branch best practices
  • How to fix Unsupported locale settings on rabbitVCS show logs
  • Retrieving git log in YYYY-MM-DD format in local time zone
  • Why should I use version control?
  • With Git feature branch workflow, when do you update the master branch?
  • 2 Solutions collect form web for “Stop Teamcity showing deleted branches”

    I suddenly had success after adding parameters to the project configuration. Before now I’ve been adding parameters to individual builds and never saw a difference.. Maybe that’s just me misunderstanding the obvious.

    enter image description here

    enter image description here

    This works in-so-far as the list of active branches is culled. There’s still one deleted branch it considers active for reasons I can’t yet decipher (history was rewritten several times in it), but at least all others are now inactive.

    I had similar question when we first started using branches in TC.

    As I recall the branches will stay visible until the conditions specified expire. It doesn’t matter if the branch has been deleted, if it had commits in the last 7 days then it will stay visible for 7 days after the last commit even if it is deleted immediately.

    So basically don’t worry, they disappear eventually and I think you can lower the teamcity.activeVcsBranch.age.days value if 7 days is too long to wait, but you will then lose branches that have no activity within that time I think.

    Git Baby is a git and github fan, let's start git clone.