Here’s a concise guide to common Git commands for version control:

🧩 Basic Workflow

  • git init
    Initialize a new repository.

    git_logo

  • git add .
    Stage all changes in the current directory.

    staging_area

  • git commit -m "message"
    Commit staged changes with a message.

    commit_icon

🌐 Branch Management

  • git branch <branch-name>
    Create a new branch.

    branch_management

  • git checkout <branch-name>
    Switch to an existing branch.

    switch_branch

  • git merge <branch-name>
    Merge changes from another branch.

    merge_icon

🔄 Remote Operations

  • git remote add origin <repository-url>
    Link to a remote repository.

    remote_repo

  • git push origin <branch-name>
    Push local changes to the remote branch.

    push_icon

  • git pull origin <branch-name>
    Fetch and merge remote changes.

    pull_icon

🔍 Useful Tips

  • Check status: git status

    status_check

  • View commit history: git log

    log_history

  • Stash changes: git stash

    stash_icon

For deeper understanding, explore our Git Tutorial section. 🌱