---
tags:
  - macOS
  - Tahoe
  - git
  - version-control
  - terminal
title: Managing Git Repositories on macOS Tahoe
---

# Managing Git Repositories on macOS Tahoe

Git is the industry-standard version control system. macOS Tahoe integrates well with Git, especially when combined with the Zsh terminal.

## Installation

macOS often comes with a version of Git installed (part of the Xcode Command Line Tools), but it is recommended to install the latest version using Homebrew to ensure you have the most recent features and security patches.

If you haven't set up Homebrew yet, refer to [Package Management with Homebrew on macOS Tahoe](homebrew.md).

To install the latest Git:

```zsh
brew install git
```

Verify the installation:

```zsh
git --version
```

## Configuration

Before using Git, you must configure your identity. This information is embedded in every commit you make.

```zsh
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
```

### macOS Keychain Integration

macOS Tahoe can securely store your Git credentials (usernames, passwords, personal access tokens) in the system Keychain, so you don't have to type them every time you push to a remote repository.

Check if the helper is already configured:

```zsh
git config --global credential.helper
```

If it returns `osxkeychain`, you are set. If not, enable it:

```zsh
git config --global credential.helper osxkeychain
```

## Basic Workflow

### Initializing a Repository

To start tracking a project:

```zsh
cd ~/Projects/my-project
git init
```

### Cloning a Repository

To download an existing repository from a remote source (like GitHub or GitLab):

```zsh
git clone https://github.com/username/repo.git
```

### Staging and Committing

1.  **Check Status**: See which files have changed.
    ```zsh
    git status
    ```
2.  **Stage Files**: Prepare files for a commit.
    ```zsh
    git add .
    ```
3.  **Commit**: Save the snapshot with a descriptive message.
    ```zsh
    git commit -m "Initial commit"
    ```

## Visualizing History

You can view the commit history directly in the terminal:

```zsh
git log --oneline --graph --all
```