GitHub SSH Key Setup & Working With Your Repo
Generating SSH keys, cloning repos, and pushing with IntelliJ
Prerequisites
| Tool | Purpose |
|---|---|
| IntelliJ IDEA | IDE for Java projects (Community edition is free) |
| Git for Windows | Includes Git Bash, a Unix-like shell for Git commands |
Git Bash is the recommended command line for working with Git on Windows. It ports Bash to Windows because Git is deeply tied into Unix tools.
Generating an SSH key
SSH keys let Git identify you to GitHub without passwords. Open Git Bash and run:
ssh-keygen
- Accept the default file location (
~/.ssh/id_...) - Leave the passphrase blank (otherwise you’ll be prompted every time you interact with GitHub)
This generates a key pair: a private key and a public key (.pub extension).
Adding the key to GitHub
Print the public key:
cat ~/.ssh/id_ed25519.pub
Copy the output, then in GitHub:
- Click your profile icon -> Settings
- Go to SSH and GPG keys
- Click New SSH key
- Give it a descriptive title (e.g. the machine name)
- Paste the public key and click Add SSH key
Cloning a repository
From the repository page on GitHub, click Code and select the SSH tab to get the SSH URL.
cd ~/Desktop
git clone git@github.com:org/repo-name.git
The first time connecting to GitHub, you’ll be asked to confirm the host - type yes.
Avoid storing code on OneDrive or similar cloud sync services. They add overhead and can cause issues with Git.
Opening the project in IntelliJ
- Open IntelliJ and select Open
- Navigate to the cloned repository
- Select the
pom.xmlfile and choose Open as Project - Trust the project when prompted
Maven will automatically download all project dependencies and configure external libraries.
If no JDK is installed, IntelliJ can download one: File -> Project Structure -> SDK -> Download JDK (e.g. Microsoft OpenJDK, language level 21).
Running tests
Right-click on any test file or directory in IntelliJ and select Run. Tests will show pass/fail status directly in the IDE.
Committing and pushing changes
IntelliJ has a built-in commit UI:
- Open the Commit tab (second icon in the left panel)
- Review changed files - select a file and press
Ctrl+Dto see the diff - Check the files to include
- Write a commit message
- Click Commit and Push to send changes to GitHub in one step
On first push, IntelliJ may ask for a Git email - this is associated with your commits.
The full cycle
- Set up SSH key and add it to GitHub
- Clone the repository using the SSH URL
- Open the project in IntelliJ via the
pom.xml - Edit code and run tests locally
- Commit and push using IntelliJ’s built-in UI
- The autograder runs automatically on GitHub Actions
- Check results in the repository’s Actions tab