How to automatically remove phonegap.js (cordova.js) from GitHub before build by phonegap build service.

If you want to use the PhoneGap Build service, you must remove the phonegap.js (cordova.js) from your source files, because PhoneGap requires a different phonegap.js JavaScript file for each platform and using an incompatible phonegap.js will result in errors when running your application.

 

For this I use the .gitignore file (https://help.github.com/articles/ignoring-files), so the phonegap.js is never pushed to the GitHub repository, but it can be used during development on the localmachine.