CocoaPods/CocoaPods#9457 (comment)
There are two issues about the source directive:
#1 The scope of the :source parameter in pod method, is not local (just for this pod method), but global.
source 'https://cdn.cocoapods.org/'
platform :ios, '9.0'
target 'PodSourceDemo' do
pod 'AFNetworking'
pod 'SocketRocket', :source => 'https://github.com/ElfSundae/CocoaPods-Specs.git'
endAFNetworking will be installed from ElfSundae/CocoaPods-Specs too.
By default the sources specified at the global level are searched in the order they are specified for a dependency match.
#2 The order of the sources is irrelevant.
source 'https://cdn.cocoapods.org/'
source 'https://github.com/ElfSundae/CocoaPods-Specs.git'
platform :ios, '9.0'
target 'PodSourceDemo' do
pod 'AFNetworking'
endAFNetworking will be installed from ElfSundae/CocoaPods-Specs.
The order of the sources is relevant. CocoaPods will use the highest version of a Pod of the first source which includes the Pod (regardless whether other sources have a higher version).