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 -Name [name] -source [feedUrl] -User [username] -pass [password]
nuget setapikey [apikey] -source [feedUrl] -configFile [configFilePath]
nuget sources add -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 -Name [name] -source [feedUrl] -User [username] -pass [password] -configFile [configFilePath] -StorePasswordInClearText