0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Azure Pipelinesの`steps.checkout`で`fatal: reference is not a tree`エラーに遭遇して解決した

Posted at

状況

複数人が高頻度で変更をプッシュするブランチ(仮にbranch1とする)をsteps.checkoutを使ってcheckoutしようとしていた。

問題のYaml

resources:
  repositories:
  - repository: MyRepo
    type: github
    endpoint: someendpoint
    name: myorg/myrepo
    ref: branch1

steps:
- checkout: MyRepo

このパイプラインを実行すると、以下のようなエラーが表示された😢

git checkout --progress --force 4808c4a0862a2c20ed832dbd1c8b2
fatal: reference is not a tree: 4808c4a0862a2c20ed832dbd1c8b2
##[warning]Git checkout failed on shallow repository, this might because of git fetch with depth '1' doesn't include the checkout commit '4808c4a0862a2c20ed832dbd1c8b2'. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=829603)
##[error]Git checkout failed with exit code: 128

解決方法

steps.checkoutfetchDepth: 0を指定する。

steps:
- checkout: MyRepo
  fetchDepth: 0

参考URL

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?