Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Feeling motivated

Matthew Roberts robertsdotpm

💭
Feeling motivated
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am robertsdotpm on github.
  • I am robertsdotpm (https://keybase.io/robertsdotpm) on keybase.
  • I have a public key ASDAsqWhui-1Ih6r-SwMYZo1MkXShwdZBq-jR6FjWESqQwo

To claim this, I am signing this object:

@robertsdotpm
robertsdotpm / resres.py
Created Mar 13, 2022
Git merge conflict resolve Python script
View resres.py
Git's merge tool is kind of shitty with respect to rebase. It doesn't seem to acknowledge the working directory? So I made a simple Python script that lets you easily resolve merge conflicts. The diff tool it uses is Visual Studio Code (which is cross-platform.) This was necessary due to Visual Studios merge diffs being read-only.
To use: install the script as /usr/bin/resres, set execute perms, mkdir ~/resres_merge , and on a conflicted file type: resres file.name. This will pop-up a diff view in Visual Studio Code. The changes you want to choose are on the left side split-view.
Once you're done resolving the merge conflict, simply run the tool again on the same file to incorporate your changes. Run the tool multiple times if necessary to resolve all conflicts. It will tell you when you're done.