Back to CLI Index

Git Version Control

git command line guide

Comprehensive Git command-line reference dashboard. Cover branching models, rebases, and remote merges.

Interactive BASH Console Sandbox
git-shell v1.2
Initializing cluster shell connection... [SUCCESS]
Type help to inspect all simulator diagnostics.
$ git

Standard Commands Included

15 commands mapped
git init Setup

Initialize a new local Git repository in the current directory.

git init my-project
git clone Setup

Clone a remote repository into a newly created local directory.

git clone https://github.com/user/repo.git
git add Staging

Stage file changes for the next commit. Use `.` to stage all changes.

git add .
git commit History

Record staged changes to the repository with a descriptive message.

git commit -m "feat: add login"
git push Sync

Upload local commits to the remote repository branch.

git push origin main
git pull Sync

Fetch and integrate remote changes into the current branch.

git pull origin main
git branch Branching

List, create, or delete branches in the local repository.

git branch feature/auth
git checkout Branching

Switch branches or restore working tree files.

git checkout main
git merge Branching

Join two or more development histories together into a single branch.

git merge feature/auth
git rebase Branching

Reapply commits on top of another base tip.

git rebase main
git status Diagnostics

Show the working tree status, staged, unstaged, and untracked files.

git status
git log History

Show commit history logs including hashes, authors, and dates.

git log -n 5
git stash Utility

Stash the changes in a dirty working directory away.

git stash pop
git reset Recovery

Reset current HEAD to the specified state, discarding or staging modifications.

git reset --hard HEAD~1
git revert Recovery

Create a new commit that reverts the effects of previous commits.

git revert a1b2c3d4