Most-Used Git/GitHub Commands

FREE Premium Multilingual Responsive Shortcode

Git: learn version control through guided practice

Git is an essential tool for software development, DevOps, SRE, automation, technical documentation, and collaborative work. It lets you save changes, compare versions, create branches, work with teams, and connect your local repository with platforms such as GitHub or GitLab.

What is Git and why does it matter?

Git records a project’s change history. Each commit works as a checkpoint that helps you review what changed, who changed it, and why. With branches, you can build new features without affecting the main version. With remotes, you can synchronize work with servers such as GitHub, GitLab, Bitbucket, or internal company repositories.

1. Control

Keeps history, supports returning to previous versions, and reduces the risk of losing work.

2. Collaboration

Supports branches, reviews, Pull Requests, Merge Requests, and teamwork.

3. Automation

Forms the foundation for CI/CD, deployments, technical auditing, and modern DevOps practices.

Interactive Git emulator

Practice commands in a safe learning environment. The emulator shows the terminal, result output, visual canvas, and textual explanation of what happens at each step.

Loading Weisewelt emulator...

40 Git commands explained

Use this table as a quick guide. Each command can be copied and pasted into the emulator to practice the Git workflow step by step.

#CommandWhat it doesWhen to use itCopy
1git --versionChecks the installed Git version.Confirm Git is installed before starting.
2git config --global user.name "Your Name"Sets the global Git user name.Initial workstation setup.
3git config --global user.email "email@domain.com"Sets the global Git user email.Associate commits with your identity.
4git config --listShows the active Git configuration.Review user, email, and settings.
5git initCreates a Git repository in the current folder.Start local version control.
6git clone https://github.com/user/project.gitDownloads a full copy of a remote repository.Work on an existing project.
7git statusShows modified, new, or staged files.Review state before committing.
8git add file.txtAdds a specific file to the staging area.Prepare a focused change.
9git add .Adds all changes from the current directory.Stage all local changes.
10git restore file.txtDiscards unstaged changes in a file.Revert unwanted local edits.
11git restore --staged file.txtRemoves a file from staging without deleting edits.Fix what was about to be committed.
12git commit -m "Clear change message"Records staged changes in history.Save a logical unit of work.
13git commit --amend -m "New message"Updates the latest local commit.Fix a message or include a forgotten file.
14git log --onelineShows compact commit history.Quickly review the timeline.
15git log --graph --oneline --decorate --allShows history with branches and references.Understand branches and merges visually.
16git diffShows unstaged differences.Review changes before git add.
17git diff --stagedShows staged differences.Validate what will enter the commit.
18git branchLists local branches.Know which branch you are working on.
19git branch feature/loginCreates a new branch without switching to it.Prepare a parallel line of work.
20git checkout -b feature/loginCreates a branch and switches to it.Start a new feature.
21git switch mainSwitches to the main branch.Return to the main branch.
22git switch -c feature/apiCreates and switches to a branch using modern syntax.Modern alternative to checkout -b.
23git merge feature/loginIntegrates a branch into the current branch.Join validated changes.
24git merge --abortCancels a merge with conflicts.Return to the pre-merge state.
25git rebase mainReapplies current branch commits on top of main.Keep a linear history before integration.
26git rebase --abortCancels an in-progress rebase.Exit a problematic rebase.
27git remote -vShows configured remote repositories.Verify origin or other remote URLs.
28git remote add origin https://github.com/user/project.gitAdds a remote repository named origin.Connect a local project to a remote server.
29git fetch originDownloads remote references without merging.Update information before deciding.
30git pull origin mainDownloads and integrates remote main changes.Update your local branch.
31git push origin mainSends local commits to remote main.Publish committed changes.
32git push -u origin feature/loginPublishes a branch and sets upstream tracking.First push of a new branch.
33git stashTemporarily saves changes without committing.Switch branches without losing work.
34git stash listLists temporarily saved changes.Review available stashes.
35git stash popRestores the latest stash and removes it from the list.Continue paused work.
36git tag v1.0.0Creates a local tag.Mark an important version.
37git push origin v1.0.0Publishes a tag to the remote.Share a released version.
38git reset --soft HEAD~1Undoes the last commit while keeping changes staged.Reorganize a recent commit.
39git reset --hard HEAD~1Deletes the last commit and its local changes.Use only when sure; it removes changes.
40git cherry-pick abc1234Applies a specific commit to the current branch.Move one targeted change between branches.
Learning recommendation Start with status, add, commit, branch, merge, pull, and push. Then move to rebase, stash, tag, reset, and cherry-pick.

50 Most-Used Azure CLI Commands and Parameters

☁️ 50 Most-Used Azure CLI Commands and Parameters (With Interactive Emulator)

Azure CLI (az) is Microsoft Azure’s official command-line tool. It helps you provision, automate, and manage cloud resources faster than using the portal for repetitive tasks. This guide gives you a practical reference with 50 high-impact commands/parameters, plus an interactive emulator so readers can “run” commands and instantly see expected output.

Learning note: Emulator output is simulated for training and onboarding. Real output can vary by subscription, region, permissions, and Azure CLI version.

🚀 Azure CLI Emulator (For Engagement and Hands-On Practice)

Try a command from the table, click Run, and see a simulated result in the terminal. You can also open the same result in a browser prompt() using Show Prompt Output.

Challenge: Run az login to start your session.
AZURE WORKSPACE
RESOURCE SCOPE 0
cloud-runbook.md 0/10

Start Azure session

Authenticate and inspect your active subscription before creating cloud resources.

Expected runbook commands az login
Start by authenticating, then inspect the current subscription.
Run the next command to receive guided feedback.
Azure Resource Visualizer Idle: no command has changed the workspace yet.
WORKSPACE OUTPUT waiting
$ Waiting for an Azure CLI command...
Run a command to see simulated Azure output here.
$ Azure CLI Emulator Ready
Tip: choose a command from the table and click "Use in Emulator".

#Command / ParameterDescriptionExampleActions

🧠 Conclusion

These 50 Azure CLI entries cover the core day-to-day operations: authentication, subscriptions, resource groups, compute, networking, storage, AKS, SQL, monitoring, and output shaping. If you practice these consistently, you’ll manage Azure infrastructure faster and with more confidence.