Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).
nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
nuget setapikey [apikey] -source [feedUrl] -configFile [configFilePath]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password] -configFile [configFilePath]
Don't bother putting the above nuget.config files into source control as they'll only work on the machine and the account that created the configs.
To be able to share credentials, use the -StorePasswordInClearText option:
nuget setapikey [apikey] -source [feedUrl] -configFile [configFilePath]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password] -configFile [configFilePath] -StorePasswordInClearText
So by following this gist, this information is bounded to the machine-level nuget.config. Following this having the same feed url inside VS or explicitly calling it from nuget.exe, it will automatically resolve that url matches one in the config and pick up the credentials from it?