Skip to content

Open Branch

Alistair McKinnell edited this page Apr 6, 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=main
  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 main to whatever you use. For example, you might have your main branch named master.
  3. This script assumes that you have installed the mine using RubyMine > Tools > Create Command-line Launcher....

Clone this wiki locally