Create a Repository

🧪 You’re starting a new Python project and want to version control it using Git and GitHub from the beginning.

1 Create Repository on GitHub

To start tracking your code with Git, the first step is to create a repository (“repo”) on GitHub. This is your project’s remote home, where your code, history, and collaboration tools live.

  1. Go to GitHub Profile
  • Open your browser and go to https://github.com/github-profile-name
  1. Go to the Repositories Tab

  1. Click New

  1. Input Repository Details
  • Repository Name: Choose a short but descriptive name (e.g., my-python-project)

  • Select a Repository Privacy: Public (anyone can see) or Private (only you and collaborators)

  • (Optional) Description: Brief summary of the project

  • (Recommended) Check Add a README file: Initializes the repo with a README.md markdown file. This file typically explains what the project is, how to use it, and any setup instructions.

  • (Recommended) Choose a .gitignore: Select a template (e.g., Python) to automatically ignore files that shouldn’t be tracked by Git—like .pyc files, virtual environments, or Jupyter Notebook checkpoints.

  • (Recommended) Add a LICENSE: A license (e.g., MIT or Apache 2.0) defines how others can use, modify, and share your code. It’s important for open-source projects to include one.

2 Cloning the Repository

Once the repo is created on GitHub, you’ll want to “clone” it—i.e., download a copy—to your local machine so you can start working on it with code editors and other tools.

  1. Open Terminal (Mac) or Command Line (Windows)

  2. Locate your GitHub folder

    cd path-to-your-github-folder
  3. Copy the HTTPS of your repository from GitHub (e.g., https://github.com/username/my-python-project.git)

  4. git clone the Repository:

    git clone https://github.com/username/my-python-project.git
  1. Open Your Repository on GitHub
  • Navigate to your repository’s page at github.com in your browser.
  1. Click the Code Button → Select Open with GitHub Desktop
  • In the repository view, click the green Code button, then select Open with GitHub Desktop. This will launch the app and prompt you to choose a local folder to clone the repository into.
You Can Clone Other Public GitHub Repositories

Explore, learn from, and even contribute to other people’s projects — that’s the power of open source!

At this point, you’ve connected your local development environment with a GitHub repository. You’re ready to start coding, tracking your work, and collaborating with others.