LoginSignup
1
1

More than 3 years have passed since last update.

【Rails】Capistranoで自動デプロイの時、git stderr: fatal: not a valid object name: master

Posted at

エラーの内容

デプロイするため、下記コマンドを実行すると、

$ bundle exec cap production deploy

このようなエラーが出ていました。(抜粋)

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

原因

masterというブランチは存在してなく、デフォルトブランチ名はmainだった。

対処方法

config/deploy.rbにて、デプロイするブランチを指定する。
(下記を追記する。)

set :branch, "main"

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1