[How to Solve] Push rejected: Push to origin/master was rejected The solution is as follows: 1. Switch to the directory where your project is located, right-click to select git bash here, ALT + F12 can be used in idea 2. In the terminl window, enter the command in turn: 2 git pull git pull origin master git pull origin master –allow-unrelated-histories 3. Push your project again in idea, success If not: git push – U origin master – F