How to use Git through IntelliJ's menus and panels (no command line needed!)
File Color Indicators
IntelliJ colors each filename to show its Git status. Click a file below to learn what the color means.
Project Files
📁my-first-project
⚙pom.xml
📄App.java
📄Calculator.java
📄NewFeature.java
📄Helper.java
Untracked
Staged
Modified
Unchanged
Unchanged
White / Gray - Committed
This file has been committed and has no changes since the last commit. Git is happily tracking it and everything is up to date.
Tip: Most of your files should be white/gray. That means your work is safely committed!
The Commit Panel
Use Ctrl + K (or Git > Commit) to open the commit panel. Follow the 3 steps below.
📝 Commit
Changed Files
Helper.javanew
Calculator.javamodified
Commit Message
✓ Changes committed successfully!
1
Check the files you want to include in this commit. You can pick some or all of the changed files.
2
Write a commit message that describes what you changed. Keep it short and clear, like: Add helper method for tax calculation
3
Click Commit to save your snapshot. Your changes are now recorded in Git's history!
Tip: Commit often! Each commit is a snapshot you can go back to. Think of it like saving your game progress.
Share Project on GitHub
This is how you connect a local IntelliJ project to GitHub for the first time.
Git
▶
GitHub
▶
Share Project on GitHub
💻
Local Project
Your code in IntelliJ
➔
🔌
IntelliJ Connects
Creates repo on GitHub
➔
🌐
GitHub Repository
Your code is online!
What happens behind the scenes: IntelliJ creates a new repository on your GitHub account, sets it as the "remote" for your project, and pushes all your committed code. You only need to do this once per project!
Tip: You may need to sign in to GitHub the first time. IntelliJ will prompt you with a browser window to authorize access.
Push & Pull
After sharing your project, use Push and Pull to keep your local code and GitHub in sync.
💻
Your Computer
Local commits in IntelliJ
Push➔
⮀Pull
🌐
GitHub
Remote repository
⬆ Git > Push (Ctrl + Shift + K)
Push sends your committed changes from IntelliJ up to GitHub.
Git > Push...
Think of it like uploading your saved work. Your commits stay local until you push them. Push when you want to back up your work or share it with others.
⬇ Git > Pull / Update Project (Ctrl + T)
Pull (or "Update Project") downloads changes from GitHub to your computer.
Git > Update Project...
Use this when someone else has pushed changes, or if you made changes on another computer. It brings your local copy up to date with what's on GitHub.
Tip: A good habit: Pull before you start working, and Push when you're done. This keeps everything in sync!