LoginSignup
6
2

More than 3 years have passed since last update.

【Salesforce】Salesforce Extensions for VS CodeのDiff機能を使えるようにする

Last updated at Posted at 2019-11-26

VisualStudioCodeの拡張機能Salesforce Extensions for VS CodeでSalesforceの環境に接続していると、コンテキストメニューに接続環境とローカルの差分チェックが行えるコマンドSFDX:Diff File Against Orgが表示されています。
diff01.png

ですが、Salesforce CLIのインストールから初期構築した状態ではプラグインが存在しない為、実行するとエラーが発生します。
diff02.png
そのため、プラグインをSalesforce CLIにインストールする必要があります。

◆インストール手順

1.コマンドプロンプト(PowerShellでも可)で以下のコマンドを実行します

sfdx plugins:install @salesforce/sfdx-diff

2.インストールするのか聞かれるので、yを入力して実行するとインストールが始まります

This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?:y

3.インストールが完了したら以下のコマンドを実行して@salesforce/sfdx-diffが表示されていればインストール成功です

sfdx plugins

diff06.png

インストール完了後、VisualStudioCodeを起動してコンテキストメニューからSFDX:Diff File Against Org実行すると接続環境とローカルの差分確認をすることができます。
diff07.png

接続環境側に追加の差分がある場合はWinMergeのようにボタンで差分を反映することができないので、手動でローカル側にコピーしてくる必要があるので注意が必要です。

◆参考

Source Diff

6
2
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
6
2