This should be fairly straightforward. Backup your Mac with Time Machine before attempting an upgrade, and set aside 1-2 hours for it.
If you have Homebrew installed, you should do the following:
-
BEFORE INSTALLING EL CAPITAN, move
/usr/local/
out of/usr
sudo mv /usr/local ~/local
-
AFTER INSTALLING EL CAPITAN, merge the directory back into
/usr/local