1

I only have a develop branch in my repository at the moment. When I try to create a project from it in Teamcity, I get the following error message:

Cannot find revision of the default branch 'refs/heads/master' of vcs root 'dummy VCS root (jetbrains.git)'

The question i:s how can I create a TeamCity build from repo without master branch? In Jenkins usually it makes no problem to build any branch

Kirill
  • 6,762
  • 4
  • 51
  • 81
  • Every project should really have a "master" branch. Maybe there's some way you can "get around it"; maybe your particular scenario is just a TeamCity restriction. But in the long run, you'd just be causing yourself grief if you DIDN'T have a "master". – paulsm4 Jun 29 '19 at 19:14
  • @paulsm4 from my point of view it is too early now. I will most probably squash all develop commits as an initial commit for master when ready – Kirill Jun 29 '19 at 19:17
  • squash all develop commits -> master; push new master -> TeamCity origin: sounds like a good idea :) – paulsm4 Jun 29 '19 at 19:19
  • Yes, you colud set any name as you wish. But always you need to identify some brach as 'main or default branch' . if you have just one branch, by definition is your 'default branch' . – Mate Jun 29 '19 at 19:23
  • So, in temacity change vcs settings and set development instead of master. Master it's just a name... The important step, it's which branch you set as default or main in your repo – Mate Jun 29 '19 at 19:31
  • as it is quite ok with git, I think this is really teamcity specific, isn't it? – OznOg Jun 29 '19 at 19:33
  • 1
    Check first answer here https://stackoverflow.com/questions/52150236/change-branch-name-when-running-custom-build-in-teamcity – Mate Jun 29 '19 at 19:55

1 Answers1

2
  1. open attached VCS Roots of your project
  2. Change Default branch to refs/heads/develop
  3. Branch specification set to +:refs/heads/*

enter image description here

Now your default branch is develop, not a master. Also, you able to see all branches because of the Branch specification

Senior Pomidor
  • 1,823
  • 1
  • 14
  • 23