I just added the platforms and plugin files to the .gitignore and ran these commands
git rm -r --cached .
git add .
git commit -m "message"
After successful pull and push, I was not able to run in the android device using the command
ionic cordova run android --device
Yes, I got the answer. I just Removed the android platform using the command
ionic cordova platform rm android
and then I added the android platform again using
ionic cordova platform add android