Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 681 Bytes

File metadata and controls

23 lines (16 loc) · 681 Bytes

概要

  • Powershell スクリプト

  • main ブランチをチェックアウトせずに main ブランチをリモートから pull --ff-only する

    • git fetch origin main:main だと fast forward 不可能な場合も上書き更新されてしまうため
  • カレントブランチが main ブランチの場合は何もせず終了

    • 作業ツリーが detached HEAD を避けるため

設定

$localMain  # ff で進める対象のローカルブランチ名
$remote     # fetch 対象のリモートリポジトリ名
$remoteMain # fetch 対象のリモートブランチ名

使用方法

.\git-pullff-main.ps1