79347936

Date: 2025-01-11 11:12:22
Score: 1
Natty:
Report link

In the Tool Bar on the top, go to Git, and a drop-down menu will appear. Click on Branches (or use the Shortcut Key Ctrl + Shift + ` ). A menu will appear regarding the branches of your repositories.

*In the newer versions of IntelliJ, you have to click on the 3 dots in the top left corner and then the Tool Bar will appear where you will find Git *

Under the Remote, you would have two branches, main and master. Click on the side arrow and delete it...

And you're all set. Next time you Commit and Push something, it will automatically be pushed to the main branch!!!

(To check if it works, after doing whatever I mentioned, click "Ctrl + Shift + K" and the Commit and Push window will appear. There, you will find "main -> origin : main" which is loudly telling out that it is going to push the changes to the main branch)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sathwik Hejamady Bhat