Skip to content

Instantly share code, notes, and snippets.

@jbodah
Created December 15, 2014 15:29
Show Gist options
  • Save jbodah/cb001f44b4bd3e480e98 to your computer and use it in GitHub Desktop.
Save jbodah/cb001f44b4bd3e480e98 to your computer and use it in GitHub Desktop.
open all unmerged files in vim
vim $(git status --porcelain | ag "(?<=UU ).*" | awk '{ print $2 }')
@jbodah
Copy link
Author

jbodah commented Dec 15, 2014

This was useful for when I was editing merge conflicts

You can iterate through in vim with

/[<=>]\{5,}

@jbodah
Copy link
Author

jbodah commented Dec 15, 2014

To test all unmerged

git status --porcelain | ag "(?<=UU )test\/" | awk '{ print $2 }' | xargs -n 1 bundle exec ruby -Itest

@jbodah
Copy link
Author

jbodah commented Dec 15, 2014

Altogether now:

vim $(git status --porcelain | ag "(?<=UU ).*" | awk '{ print $2 }') && git status --porcelain | ag "(?<=UU )test\/" | awk '{ print $2 }' | xargs -n 1 bundle exec ruby -Itest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment