NUS Hackers Wiki
NUS Hackers Wiki
  • NUS Hackers Wiki
  • Hackerschool
    • Virtual Machines and Linux
    • Beginners' Guide to the Terminal
      • Introduction to the Terminal
      • Modern Shell Tools
      • Shell Scripting
      • Real World Scripting
      • Resources
    • Self-Hosting: Three Easy Pieces
      • 1. Setting up your server
      • 2. Running Services
      • 3. Monitoring your server
    • Vim
    • Introduction to Zig
      • Language Basics
      • Error Handling
      • Memory Management
      • Working with C
      • Exploring comptime
    • CI/CD with Github Actions
      • Background
      • Basics of Github Actions
        • Target workflow
        • Running unit tests
        • Linting code
        • Deploying to Github Pages
      • Advanced use cases
        • Pollers
        • Github script
        • Executing third-party scripts
        • Reusable workflows
      • Cookbook
    • Lightning Git
      • Git Concepts
      • Getting Started with Git
      • Making your first commit
      • Branching
      • Merge Conflicts
      • Integrating remote repositories
      • Collaborative Workflows
      • Commit Manipulation and Reflog
      • Interactive rebasing
      • filter-repo
  • Orbital
    • JavaScript
      • Browser Developer Tools
      • Getting Started
      • Datatypes
      • Operators and Operations
      • Loops and Conditions
      • Functions
      • Strings
      • Arrays
      • HTML
        • Getting Started
        • Tag Attributes
        • HTML Forms
        • Browser Inspector
      • CSS
        • Selectors
        • Colors in CSS
        • Measurements in CSS
        • The Box Model
        • Adding Styles - Part 1
        • Adding Styles - Part 2
      • Working with the DOM
        • Querying the DOM - Selectors
        • Querying the DOM - Element Attributes
        • Querying the DOM - Element Styles
        • Events with JS and HTML
        • Exercise: Click Counter
        • Editing the DOM
        • Fetch Requests
        • Exercise: The NUSMods API
    • React
      • Setup
      • State
    • React Native
      • Setup
      • Intro to JSX
      • Basic Syntax
      • Handling UI
      • Props
      • State Management
    • Git
      • Setup
      • Command Glossary
      • Fundamental Concepts
        • Getting Started
        • Integrating Remote Repositories
        • Branching
        • Merge Conflicts
      • Collaborative Workflows
        • Fork and PR Workflow
        • Branch and PR Workflow
      • Advanced Concepts
        • Ignoring Files
        • Commit Message Conventions
        • Github Collaborators
        • CI/CD with Github Actions
        • Advanced Git Commands
      • FAQ
    • Telegram Bot
      • Creating a TeleBot
      • API Calls
      • Telebot Basics
      • Integrating API's
    • Relational Database
      • Database Overview
      • Database Design
      • Entity Relationship Diagram
      • SQL Basics & PostgreSQL
    • TypeScript
      • Types and Interfaces
      • Utility Types
      • Typing Component Props, Events, and Hooks
      • Why You Should Avoid Using any (and What to Do Instead)
      • TypeScript Tricks You’ll Use All the Time in React
Powered by GitBook
On this page
  • Setup
  • Making Changes
  • Viewing State
  • Working with Branches
  • Working with Remotes
  • Miscellaneous
Edit on GitHub
Export as PDF
  1. Orbital
  2. Git

Command Glossary

Setup

Command
Usage

git init

Initialise repository

git config <option> <value>

e.g. git config --global user.email

Making Changes

Command
Usage

git add <file/directory>

Stage changes (use . to add everything)

git commit -m "<message>"

Commit staged changes

git reset <file>

Unstage changes

git restore <file>

Discard changes

git revert <commit>

Undo changes

Viewing State

Command
Usage

git status

View tracked/untracked files

git reflog

List all local changes

git log

List repository history

git show

Show current commit

git diff <A> <B>

Show differences between A and B (A and B can either be commits or branches)

git diff --staged

Show changes made by staged files

Working with Branches

Command
Usage

git branch

List branches

git checkout <branch>

Switch into a different branch

git checkout -b <branch>

Create and switch into a new branch

git branch -d <branch>

Delete branch

git merge <branch>

Applies the changes from <branch> into the current branch

Working with Remotes

Command
Usage

git clone <url>

Copy a remote repository

git fetch

Fetch changes from the remote

git pull

Pull updates from remote to local (default iis via merge, use --rebase to specify rebase)

git push

Push changes to remote

Miscellaneous

Command
Usage

git <command> -h

Show command usage

git <command> --help

Show detailed help page

git blame <file>

Show who last modified each line in a file

PreviousSetupNextFundamental Concepts

Last updated 7 hours ago