Skip to content

Instantly share code, notes, and snippets.

@dataBaseError
Last active January 19, 2016 22:20
Show Gist options
  • Save dataBaseError/85810cc05bcdffb73b69 to your computer and use it in GitHub Desktop.
Save dataBaseError/85810cc05bcdffb73b69 to your computer and use it in GitHub Desktop.
Install and setup meld to be used by git
#!/bin/bash
# This script sets up meld as the diff tool.
sudo apt-get install python2.7
sudo apt-get install meld
DIFF_FILE=/tmp/diff.py
TARGET=/usr/bin/diff.py
echo "
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))" > "${DIFF_FILE}"
# Correct empty initial new line
sed -i '/./,$!d' "${DIFF_FILE}"
# Move to the right place
sudo mv "${DIFF_FILE}" "${TARGET}"
# Make the script executable
sudo chmod +x "${TARGET}"
# Configure git
git config --global merge.tool meld
git config --global diff.external "${TARGET}"
# Setting up SSH
(firefox https://help.github.com/articles/generating-ssh-keys/#platform-linux > /dev/null 2>&1) &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment