abhilashthale.tech
  • Home
  • Modern Blog
  • BlogCategories
    • coding
    • other
    • n
  • Images to Pdf
  • My Files
  • Shares Average
  • About Me
  • Server Stats
  • Day
  • Night
  • Birds
  • Waves
  • Net
  • Dots
  • Halo
  • Rings
  • Fog
  • Clouds

    Git Cheat Sheet With Inline Info

    by abhilashthale - Oct. 17, 2026

    # Initialize & Clone
    git init                 # Create a new repository in current folder
    git clone <url>          # Copy a remote repo locally

    # Status & Commit
    git status               # Show repo state (staged/unstaged files)
    git add .                # Stage all changes
    git commit -m "msg"      # Save snapshot with message
    git log --oneline        # Compact commit history
    git diff                 # Show changes not staged/committed

    # Branching
    git branch               # List branches
    git branch <name>        # Create new branch
    git checkout <name>      # Switch branch
    git checkout -b <name>   # Create + switch branch
    git merge <branch>       # Merge branch into current
    git rebase <branch>      # Reapply commits on top of branch

    # Remote
    git remote -v            # Show remotes
    git remote add origin <url>   # Add remote repo
    git push origin main     # Push changes to remote main
    git pull origin main     # Fetch + merge from remote main
    git fetch origin         # Fetch without merging

    # Undo & Reset
    git reset <file>         # Unstage file
    git checkout -- <file>   # Discard local changes
    git revert <commit>      # Undo commit safely (new commit)
    git reset --hard <commit> # Reset repo to commit (dangerous)

    # Stash
    git stash                # Save changes temporarily
    git stash list           # Show stashes
    git stash apply          # Reapply latest stash
    git stash drop           # Delete latest stash
     

abhilashthale.tech