How to Push to a GitHub Repository in IntelliJ
1. Initialize and Connect the Git Repository
# Run in the terminal from the project root
git init
git remote add origin https://github.com/[user]/[repository].git
2. Configure Git in IntelliJ
- Select
VCS→Enable Version Control Integration. - Choose
Gitand clickOK.
3. Connect Your GitHub Account
- Go to
File→Settings(on Windows) orIntelliJ IDEA→Preferences(on macOS). - Navigate to
Version Control→GitHub. - Click
Add Account(+). - Select
Log In with Token...and enter your GitHub Personal Access Token.
4. Add and Commit Files
- Go to
VCS→Git→Add(or use the shortcutCtrl+Alt+A). - Select the files you want to commit.
- Go to
VCS→Commit(or use the shortcutCtrl+K). - Write a commit message and click
Commit.
5. Push
- Go to
VCS→Git→Push(or use the shortcutCtrl+Shift+K). - Click the
Pushbutton.
Simpler Method (Using IntelliJ's Built-in Feature)
- Go to
VCS→Share Project on GitHub. - Set the repository name to
vita-user-service. - Click
Share.
If the repository already exists on GitHub, you can simply add the remote and then push.

Comments
Post a Comment