Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am improving my friend's LaTeX document at folder 1/2, while he is editing the folder 1/1.

The initial contents of the folders is the same.

How can you meld the two folders to one such that all files are melded?

share|improve this question
up vote 9 down vote accepted

You're wanting to find the differences in files in two folders and merge the changes?

If you're looking for a GUI utility you can use FileMerge which can be found at /Developer/Applications/Utilities/ if you have Apple's Developer Tools installed. It has some odd bugs - mostly to deal with handling file encoding.

If you're looking for something faster and nicer check out - it's not cheap but has been worth the price of admission several times over for me.

If you want to do it via the command line you can use diff to find the differences and then manually merge the files together as it will list all the differences. (eg. diff ~/Desktop/a ~/Desktop/b)

share|improve this answer

Since the mac is running a version of unix, you can use all of the tried, tested and true commands from the established UNIX heritage.

UNIX Shell Comparison of Directories Tutorial

share|improve this answer

The following code is made by Git-community

# must not already be open before running
# this script, or opendiff below will return immediately,
# and the TMPDIRs deleted before it gets the chance to read
# them.

[ \$# -eq 7 ] && opendiff "\$2" "\$5"
chmod +x
GIT_EXTERNAL_DIFF=./ git-diff 

if test $# = 0; then
elif test "$1" = --cached; then
if test $# -gt 0; then
   OLD="$1"; shift
test $# -gt 0 && test -z "$CACHED" && NEW="$1"

TMPDIR1=`mktemp -d`
git-archive --format=tar $OLD | (cd $TMPDIR1; tar xf -)
if test -z "$NEW"; then
   TMPDIR2=$(git rev-parse --show-cdup)
   test -z "$cdup" && TMPDIR2=.
   TMPDIR2=`mktemp -d`
   git-archive --format=tar $NEW | (cd $TMPDIR2; tar xf -)

opendiff $TMPDIR1 $TMPDIR2 | cat
rm -rf $TMPDIR1
test ! -z "$NEW" && rm -rf $TMPDIR2

You can then run

opendiff folder1 folder2

to achieve what I want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.