Skip to content

Instantly share code, notes, and snippets.

@galori
Forked from tony4d/p4merge4git.md
Last active August 29, 2015 14:23

Revisions

  1. galori revised this gist Jun 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ Setup p4merge as a visual diff tool

    [[ **Redacted** ]]

    Its possible to set up p4merge also as a _diff_ tool, but then every time you do a "git merge" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.
    Its possible to set up p4merge also as a _diff_ tool, but then every time you do a "git diff" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.

    Using p4merge to resolve conflicts
    ----------------------
  2. galori revised this gist Jun 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ Setup p4merge as a visual diff tool

    [[ **Redacted** ]]

    Its possible to set up p4merge as a merge tool, but then every time you do a "git merge" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.
    Its possible to set up p4merge also as a _diff_ tool, but then every time you do a "git merge" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.

    Using p4merge to resolve conflicts
    ----------------------
  3. galori revised this gist Jun 15, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,7 @@ Setup p4merge as a visual diff tool
    ----------------------

    [[ **Redacted** ]]

    Its possible to set up p4merge as a merge tool, but then every time you do a "git merge" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.

    Using p4merge to resolve conflicts
  4. galori revised this gist Jun 15, 2015. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -17,9 +17,8 @@ Setup p4merge as a visual mergetool
    Setup p4merge as a visual diff tool
    ----------------------

    $ git config --global diff.tool p4mergetool
    $ git config --global difftool.p4mergetool.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"
    [[ **Redacted** ]]
    Its possible to set up p4merge as a merge tool, but then every time you do a "git merge" in the shell it will launch p4merge, which is not desirable (at least for me). If you're interested in configuring p4merge this way then look at the gist that this gist was forked from - it still has that info.

    Using p4merge to resolve conflicts
    ----------------------
  5. Tony Ford revised this gist Aug 27, 2012. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,16 @@ Setup p4merge as a visual diff tool

    $ git config --global diff.tool p4mergetool
    $ git config --global difftool.p4mergetool.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"

    Using p4merge to resolve conflicts
    ----------------------

    When you run into a conflict when merging simply run:

    $ git mergetool

    * You will be prompted to run "p4mergetool", hit enter and the visual merge editor will launch.
    * Using the merge tool you can resolve the conflict and then save the file.
    * After you exit the merge tool take a look back at your terminal. You will be asked if the merge was successful, choose yes if all is well or no if you need to start over.
    * This prompting is happening because the "trustExitCode" option is turned off. Personally I always like to be asked, but you can have git just trust the exit code from the merge tool.
  6. Tony Ford revised this gist Aug 27, 2012. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -8,15 +8,15 @@ Download and install p4merge
    Setup p4merge as a visual mergetool
    ----------------------

    $ git config --global merge.tool p4merge
    $ git config --global mergetool.p4merge.cmd \
    $ git config --global merge.tool p4mergetool
    $ git config --global mergetool.p4mergetool.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED"
    $ git config --global mergetool.p4merge.trustExitCode false
    $ git config --global mergetool.p4mergetool.trustExitCode false
    $ git config --global mergetool.keepBackup false

    Setup p4merge as a visual diff tool
    ----------------------

    $ git config --global diff.tool p4merge
    $ git config --global difftool.p4merge.cmd \
    $ git config --global diff.tool p4mergetool
    $ git config --global difftool.p4mergetool.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"
  7. Tony Ford created this gist Aug 24, 2012.
    22 changes: 22 additions & 0 deletions p4merge4git.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    Download and install p4merge
    ---------------

    * Download the perforce visual tool suite from here: http://www.perforce.com/perforce/downloads/index.html
    * Copy only the p4merge.app file into your /Applications/ directory


    Setup p4merge as a visual mergetool
    ----------------------

    $ git config --global merge.tool p4merge
    $ git config --global mergetool.p4merge.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED"
    $ git config --global mergetool.p4merge.trustExitCode false
    $ git config --global mergetool.keepBackup false

    Setup p4merge as a visual diff tool
    ----------------------

    $ git config --global diff.tool p4merge
    $ git config --global difftool.p4merge.cmd \
    "/Applications/p4merge.app/Contents/Resources/launchp4merge \$LOCAL \$REMOTE"