Fundamentals 5 min read

Master Git Basics: From Repository Creation to IDEA Integration

This guide walks you through creating a remote GitHub repository, cloning it locally, using essential push/pull commands, and integrating Git operations within IntelliJ IDEA, providing clear step‑by‑step instructions and command examples for effective version control.

Raymond Ops
Raymond Ops
Raymond Ops
Master Git Basics: From Repository Creation to IDEA Integration

Git Overview

Key steps include creating a remote repository, cloning code, and using push/pull commands.

Create a remote repository on GitHub: log in, click the "+" button, choose New repository , fill in the name and options, then invite team members.

Create repository UI
Create repository UI

Clone the repository: copy the repository URL, open Git Bash in the desired local directory, and run:

git clone https://github.com/YourUser/Repo.git
Clone repository UI
Clone repository UI

Common remote and branch commands:

git clone <repo-url>               // clone remote repository
git remote -v                     // view remote aliases (default: origin)
git remote add <name> <url>       // add a remote alias
git branch -v                     // list branches
git branch <name>                 // create a branch
git checkout <name>               // switch to a branch
git push <remote> <branch>        // push to remote
git pull <remote> <branch>        // pull from remote

Typical workflow for committing changes:

git add <file>
git commit -m "message"
git push origin master
git pull origin master

Additional useful commands: git reflog , git log , git reset --hard <commit> , git merge <branch> , git rm --cached <file> , etc.

IDEA Integration

Configure IntelliJ IDEA to work with Git and perform repository operations directly from the IDE.

Set the Git executable path in IDEA settings.

IDEA Git settings
IDEA Git settings

Create a Git repository from within IDEA.

Create repository in IDEA
Create repository in IDEA

Clone, push, and pull repositories using IDEA's UI.

IDEA clone/push/pull
IDEA clone/push/pull

Add and commit files via the IDE.

Add/commit in IDEA
Add/commit in IDEA

Switch to a specific version (commit or tag) using the IDE's history view.

Switch version in IDEA
Switch version in IDEA

Create a new branch and switch to it directly from IDEA.

Create and switch branch in IDEA
Create and switch branch in IDEA
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

command-lineTutorialIDEAremote repository
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.