Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GitVersion #273

Open
savornicesei opened this issue May 6, 2019 · 0 comments
Open

Support GitVersion #273

savornicesei opened this issue May 6, 2019 · 0 comments

Comments

@savornicesei
Copy link
Contributor

Hi,
CC.NET cannot succesfully build a project using git as source control and GitVersion for versioning.
GitVersion fails with the error

GitTools.WarningException: It looks like the branch being examined is a detached Head pointing to commit '3bd952f'. Without a proper branch name GitVersion cannot determine the build version.
at GitVersion.GitVersionFinder.EnsureHeadIsNotDetached(GitVersionContext context)
at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)
at GitVersion.ExecuteCore.<>c__DisplayClass6_0.b__0(IRepository repo)
at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
at GitVersion.Program.VerifyArgumentsAndRun()

This is caused by using git checkout -q -f origin\branch_name instead of git checkout -q -f ref\heads\branch_name or git checkout -b origin\branch_name (according to official documentation and this answer on StackOverflow).

savornicesei added a commit to savornicesei/CruiseControl.NET that referenced this issue Jan 20, 2020
- change git fetch command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant