LoginSignup
0
0

Jenkinsジョブで "git clone <url>" した後と同じ状態にするには

Last updated at Posted at 2020-06-08
  • ソースコード管理
    • Git
      • リポジトリ
        • リポジトリURL : https://~~.git
        • 認証情報 : free
        • 名称 : null
        • Refspec : null
      • ビルドするブランチ
        • ブランチ指定子 (空欄はすべてを指定) : refs/heads/master
      • リポジトリ・ブラウザ : (自動)
  • ビルド開始前にワークスペースを削除する : on
  • ビルド
    • シェルの実行
      • シェルスクリプト :
git checkout master
git remote set-head origin master

追記

シェルスクリプトの内容と、Check out to specific local branch がイコールであることを後で知りました

  • ソースコード管理
    • Git
      • 追加処理 : Check out to specific local branch
        • ブランチ名 : **
Check out to specific local branch のヒント
リビジョンをチェックアウトして、このブランチのヘッドとしてビルドします。
空文字や"**"を設定すると、ブランチ名はoriginを含まないリモートのブランチから算出します。その場合、 リモートブランチorigin/masterは、ローカルブランチmasterにチェックアウトされ、 リモートブランチorigin/develop/new-featureは、 ローカルブランチdevelop/new-featureにチェックアウトされます。

サブモジュールではテストされていないことに注意してください。
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