Surprisingly, Apple has actually made this pretty easy. This works for Yosemite and El Capitan, and I’m assuming future versions too.
Make sure you have the installer downloaded from the app store. It will delete itself after you use it, but you can download it again.
Format an 8 GB flash drive and plug the thing in. Leaving it named “Untitled” is easiest, but you can change it. Just make sure to change any instances of “Untitled” in the command line below.
For El Capitan, Bust our your Terminal, and copypaste this:
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
Pretty much the same for Yosemite:
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
any idea if one could use this with a partitioned USB stick and have Mavs on the other side? Or Yos and El Cap on the 2 sides?