【Rails】 When auto-deploying with Capistrano, git stderr: fatal: not a valid object name: master

1

What is the error?

To deploy, execute the following command,

$ bundle exec cap production deploy

I was getting an error like this. (Excerpt)

# エラーログ
git stdout: Nothing written
git stderr: fatal: not a valid object name: master

cause

There was no branch called master, and the default branch name was main.

What to do

In config/deploy.rb, specify the branch to be deployed. (The following is added.) )

set :branch, "main"

reference

Share:
1
Author by

2021年7月から機械系エンジニアからwebエンジニアにジョブチェンジしました。php、node.js、typescript、angular等で開発してます。

Updated on February 23, 2021