cd /news/developer-tools/powershell-wednesday-git-101 · home topics developer-tools article
[ARTICLE · art-9756] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

PowerShell Wednesday Git 101

This article provides a concise reference guide for essential Git commands, covering repository initialization, file tracking, committing, and remote setup. It also explains branching operations, including creation, switching, and deletion, as well as how to fetch and pull changes from a remote repository. Additionally, the guide clarifies that a Pull Request (PR) is functionally a "Merge Request," as used by platforms like GitLab.

read2 min views16 publishedApr 29, 2026

git init #

Initialize a Git directory as a repository. git init


git add #

Track files with Git (A.K.A. Git now knows and cares about these files)

git add <filename>

or add everything in the folder

git add .


git commit #

Commit staged files to the repository history.

git commit -m "your message here"

or interactive commit message

git commit


git remote #

Set up a remote repository (e.g. GitHub, GitLab, etc.) Most SCM providers will give you the command!

git remote add origin <url>

View current remotes:

git remote -v


git push #

Push commits to a remote repository.

git push

Push and set the upstream tracking reference (first push of a branch):

git push -u origin <branch-name>

After -u is set once, future pushes from that branch only need:

git push


git branch, git checkout, and git switch #

Create a new branch:

git branch <branch-name>

Switch to an existing branch:

git checkout <branch-name>

or (newer syntax):

git switch <branch-name>

Create and switch in one step:

git checkout -b <branch-name>

or (newer syntax):

git switch -c <branch-name>

List Branches: git branch

Remove a branch: git branch -d <branch-name>


git pull and git fetch #

Fetch any branches from origin to your local working copy:

git fetch

Pull any upstream changes into your working copy:

git pull


git checkout #

Check out a specific commit (detached HEAD state — you're looking, not working):

git checkout <commit-hash>

Check out a specific branch:

git checkout <branch-name>


Git Configuration Options #

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

git config --global core.editor "nvim"

Git Stages #

Stage/State Description
Untracked File exists but Git has never been told about it.
Staged (Indexed) git add was run for this file and Git is now tracking it.
Modified (Unstaged) A committed file was edited. Git sees the difference but it is not staged yet.
Committed The file has been committed with git commit and is now part of the repo history.
Ignored Git has been instructed to ignore the file via .gitignore.

Git SCMs #

Think of a Pull Request (PR) more as a "Merge Request". Some SCM platforms like Gitlab specifically call them MRs.

── more in #developer-tools 4 stories · sorted by recency
── more on @git 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/powershell-wednesday…] indexed:0 read:2min 2026-04-29 ·