Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
2,415

Working in a corporate environment often means using private repositories hosted on GitHub Enterprise. If you're on a Mac and prefer the Terminal, here’s a simple step-by-step guide to clone the repo and get started with VS Code.

Prerequisites

  • Homebrew:  Install Homebrew if its not already available.
  • Git: Check if git is installed by running
which git
git --version​

If not installed, install it using:

brew install git​
  • Visual Studio Code: If not installed download it from Visual Studio Code
  • Access to your company’s GitHub Enterprise (e.g., GitHub Enterprise or another corporate Git)
  • Personal Access Token (PAT): GitHub no longer supports password-based authentication for Git over HTTPS. Instead, it requires a Personal Access Token (PAT) - safer, more flexible way to authenticate.

    GitHub currently supports two types of PATs:

    • Classic

    • Fine-Grained

           I used the Classic Token because it is recommended when you're working with GitHub Enterprise Server and the fine-grained token is still in the beta phase. 

           You can generate PATs at GitHub → Settings → Developer Settings → Personal Access Tokens.

SugandhaSachdeva_1-1751625219727.png

  • UV (optional): A modern Python dependency manager
brew install uv​

Steps

1. Verify Git is Installed

which git
git --version​

2. Install GitHub Repositories Extension in VS Code

In VS Code:

  • Press Cmd + Shift + X (or click Extensions)

  • Search and install GitHub Repositories by GitHub

3. Clone the Repository via Terminal

git clone https://github.company.com/your-team/your-repo.git​


When prompted,

  • enter your GitHub username

  • your Personal Access Token instead of a password.

I initially tried using VS Code directly to clone the repository, but it proved not be too straight forward for GitHub Enterprise with custom domains. Using the terminal proved to be much easier and quicker for me.

4. Navigate into the Cloned Repository

cd your-repo​

5. Open the Project in VS Code

code .

If code is not recognized:

  • Open VS Code

  • Press Cmd + Shift + P

  • Run: Shell Command: Install 'code' command in PATH

6. Install Python Extensions in VS Code

If you're working on a Python project, consider installing the following VS Code extensions:

  • Python
  • Jupyter
  • Black Formatter

7. Install Python Project Dependencies with uv (Optional)

If your project includes a pyproject.toml, you can install dependencies using uv:

In the VS Code terminal:

uv sync

Summary: 

Cloning a private repository from GitHub Enterprise on a Mac can be smooth and efficient with the right setup. By using the Terminal alongside VS Code, you avoid the complexities that sometimes arise with GitHub Enterprise's custom domains in the GUI. This guide walks you through the essentials—setting up Git, generating a Personal Access Token (especially using the Classic token for GitHub Enterprise), and configuring your environment with useful tools like uv and Python extensions. Once everything is in place, working on your codebase in VS Code becomes fast and seamless.

2 Comments
Vitaliy-R
Developer Advocate
Developer Advocate

Thanks for sharing this, @SugandhaSachdeva 

While I understand what you are trying to achieve, I think the level of details described in your post are not enough for most of the readers to understand the problem and the solution.

@Vitaliy-R  - I really appreciate your honest feedback. Let us please connect so I can understand in detail what information can make the post more understandable for the readers.