Git install

Windows — Install Git (step by step)

Option A — Easiest (official installer)

Download

Go to: https://git-scm.com/download/win (downloads start automatically).
You’ll get something like Git-<version>-64-bit.exe.

Run th…


This content originally appeared on DEV Community and was authored by Aisalkyn Aidarova

Windows — Install Git (step by step)

Option A — Easiest (official installer)

  1. Download
  1. Run the installer
  • Double-click the .exe.
  • When the wizard asks:

    • Adjusting your PATH → choose “Git from the command line and also from 3rd-party software”.
    • Default editor → choose Vim (default) or pick Notepad++/VS Code if you prefer.
    • Let Git decide line endings → choose “Checkout Windows-style, commit Unix-style (recommended)”.
    • Git Credential ManagerEnable (recommended).
    • SSH executableUse bundled OpenSSH.
    • Terminal emulatorUse Windows’ default console (or MinTTY if you like).
    • Enable file system cachingYes.
    • Leave other defaults unless you know you need something else.
  1. Verify installation
  • Open Command Prompt or PowerShell and run:

     git --version
    

    You should see a version number.

  1. Configure your identity
   git config --global user.name "Your Name"
   git config --global user.email "you@example.com"
  1. (Optional but recommended) Set default branch name to main
   git config --global init.defaultBranch main
  1. (Optional) Improve credential & line ending behavior
   git config --global core.autocrlf true
   git config --global credential.helper manager
  1. (Optional) Install Git LFS (for large files)
  • Re-run the Git installer and tick Git LFS, or:

     winget install Git.GitLFS
     git lfs install
    

Option B — Using Winget (built-in on modern Windows 10/11)

winget install --id Git.Git -e
git --version

Option C — Using Chocolatey (if you already use choco)

choco install git -y
git --version

macOS — Install Git (step by step)

Option A — Using Homebrew (recommended if you already use brew)

  1. Install Homebrew (if you don’t have it)
   /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
   brew update
  1. Install Git
   brew install git
   git --version

Option B — Xcode Command Line Tools (no Homebrew needed)

  1. Run:
   xcode-select --install
  1. In the popup, choose Install.
  2. Verify:
   git --version

Option C — Official macOS installer

  1. Download the latest .pkg from https://git-scm.com/download/mac
  2. Open the .pkg → follow the prompts.
  3. Verify:
   git --version

Configure Git on macOS

  1. Identity
   git config --global user.name "Your Name"
   git config --global user.email "you@example.com"
  1. Default branch
   git config --global init.defaultBranch main
  1. Credentials stored in Keychain
   git config --global credential.helper osxkeychain

One-time SSH setup (Windows & macOS)

Use this if you’ll push to GitHub/GitLab/Bitbucket over SSH (recommended for fewer password prompts).

  1. Generate a key (ed25519)
   ssh-keygen -t ed25519 -C "you@example.com"
  • Press Enter to accept default location (~/.ssh/id_ed25519).
  • Optionally set a passphrase.
  1. Start the SSH agent & add your key
  • macOS (zsh/bash):

     eval "$(ssh-agent -s)"
     ssh-add ~/.ssh/id_ed25519
    
  • Windows PowerShell (Git Bash similar):

     eval "$(ssh-agent -s)"
     ssh-add ~/.ssh/id_ed25519
    
  1. Copy your public key
  • macOS:

     pbcopy < ~/.ssh/id_ed25519.pub
    
  • Windows (PowerShell):

     Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
    
  1. Add to your Git host
  • GitHub: Settings → SSH and GPG keys → New SSH key → paste → Save.
  • GitLab/Bitbucket: similar path under SSH Keys.
  1. Test
   ssh -T git@github.com

You should see a success message (first time may ask to trust the host).

Quick sanity test (both platforms)

mkdir git-test && cd git-test
git init
echo "hello" > README.md
git add README.md
git commit -m "first commit"
git log --oneline

Keeping Git up to date

  • Windows (winget):
  winget upgrade Git.Git
  • Windows (installer): download/run the newest .exe from git-scm.com; it upgrades in place.
  • macOS (Homebrew):
  brew upgrade git
  • macOS (Xcode CLT):

    • Run softwareupdate --all --install --force or reinstall CLT with xcode-select --install.

Common issues & fixes

  • git: command not found

    • Windows: close/reopen terminal; ensure Git is on PATH (re-run installer and select PATH option).
    • macOS: install via xcode-select --install or brew install git.
  • Corporate proxy blocks

    Configure Git to use your proxy:

  git config --global http.proxy http://USER:PASS@proxy.company.com:8080
  git config --global https.proxy http://USER:PASS@proxy.company.com:8080
  • Permission denied (publickey) Your SSH key isn’t added or not uploaded to Git host. Re-run the SSH steps above and test with:
  ssh -T git@github.com
  • Multiple Git versions on macOS Check which Git runs:
  which git

Prefer Homebrew Git (/usr/local/bin/git on Intel, /opt/homebrew/bin/git on Apple Silicon). If needed, adjust your shell PATH to put Homebrew first.


This content originally appeared on DEV Community and was authored by Aisalkyn Aidarova


Print Share Comment Cite Upload Translate Updates
APA

Aisalkyn Aidarova | Sciencx (2025-11-08T03:09:24+00:00) Git install. Retrieved from https://www.scien.cx/2025/11/08/git-install/

MLA
" » Git install." Aisalkyn Aidarova | Sciencx - Saturday November 8, 2025, https://www.scien.cx/2025/11/08/git-install/
HARVARD
Aisalkyn Aidarova | Sciencx Saturday November 8, 2025 » Git install., viewed ,<https://www.scien.cx/2025/11/08/git-install/>
VANCOUVER
Aisalkyn Aidarova | Sciencx - » Git install. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/08/git-install/
CHICAGO
" » Git install." Aisalkyn Aidarova | Sciencx - Accessed . https://www.scien.cx/2025/11/08/git-install/
IEEE
" » Git install." Aisalkyn Aidarova | Sciencx [Online]. Available: https://www.scien.cx/2025/11/08/git-install/. [Accessed: ]
rf:citation
» Git install | Aisalkyn Aidarova | Sciencx | https://www.scien.cx/2025/11/08/git-install/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.