Skip to content

Open Branch

Alistair McKinnell edited this page Jan 20, 2022 · 4 revisions

Rationale

From the command line open all the files from a git feature branch in RubyMine.

Mechanism

Add this command line script to your shell:

mine_branch () {
  if [[ "$1" == "" ]]
  then
    branch=master
  else
    branch=$1
  fi
  git diff --name-only --diff-filter=d $branch | xargs -r mine .
}

Notes:

  1. You will need to brew install findutils and follow instructions to get the -r option for xargs.
  2. Change master to whatever you use. For example, you have switched to main.
  3. This script assumes that you have installed the mine using RubyMine > Tools > Create Command-line Launcher....

Clone this wiki locally