Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Beyond Compare and WSL

Beyond Compare and WSL

Scheduled Pinned Locked Moved The Lounge
linuxcomcollaborationlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #1

    Posting this since it's not so easy to find online. But, if you find yourself using WSL _and_ use Beyond Compare (outside of git) on the Windows side, here's a doodle to make your life easier. In your bash or zsh resource file, add this function and re-source it or logout and back in.

    function bcomp() {
    local path='/mnt/c/Progra~1/Beyond~1/BComp.exe'
    "$path \"$(wslpath -aw "$1")\" \"$(wslpath -aw "$2")\""
    }

    Now, in your Linux install you can simply do `bcomp file1 file2` anywhere and have BC pop up with the diff on your Windows machine. Tada! Edit: Here's a git config for using BC in WSL for poops and giggles too. So you can use `difftool` inside WSL and have it pop up in BC on Windows.

    [user]
    name = Bro Dude
    email = brod@dude.com
    [diff]
    tool = bc
    [difftool "bc"]
    cmd = /mnt/c/Progra~1/Beyond~1/BComp.exe "$(wslpath -aw \"$REMOTE\")" "$(wslpath -aw \"$LOCAL\")"
    path = /mnt/c/Progra~1/Beyond~1/BComp.exe
    trustExitCode = true
    [merge]
    tool = bc
    [mergetool "bc"]
    cmd = /mnt/c/Progra~1/Beyond~1/BComp.exe "$(wslpath -aw \"$REMOTE\")" "$(wslpath -aw \"$LOCAL\")" "$(wslpath -aw \"$BASE\")" "$(wslpath -aw \"$MERGED\")"
    path = /mnt/c/Progra~1/Beyond~1/BComp.exe
    trustExitCode = true
    [difftool]
    prompt = false
    [mergetool]
    prompt = false

    Jeremy Falcon

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups