Skip to content

Part 2 Creating a Repository

Jesper Nielsen edited this page Mar 16, 2026 · 1 revision

This page walks through creating and configuring a GitHub repository from scratch. By the end, you will have a fully configured repository with a wiki, ready for collaboration.

A repository is just a folder, it is as simple as that.
And then you add configuration files to make it a repository.

That is the core idea behind this part - start simple, then layer on the configuration that turns a folder into a well-structured, collaborative workspace.

For installation, configuration, and setup, see the Part 1 Getting Started page. For writing documentation and structuring repository files, see the Part 3 Repository Essentials page.

Creating a GitHub repository

Creating a repository on GitHub gives you a central place to store and share your files, scripts, and documentation.

Step-by-step guide

Follow these steps to create a new repository on GitHub:

  1. Go to GitHub and sign in with your account
  2. Click the + icon in the top-right corner and select New repository
  3. Enter a repository name - use lowercase with hyphens (e.g., my-scripts)
  4. Add a description that explains the purpose of the repository
  5. Choose Public or Private visibility
  6. Check Add a README file to create an initial README.md
  7. Optionally add a .gitignore template and a .LICENSE file
  8. Click Create repository

Editing repository details

Editing repository details helps visitors understand the purpose of the repository and improves discoverability. After creating the repository, click the gear icon next to About on the repository page to edit the details:

  • Description - Add a short summary of the repository (e.g., "This repository contains the source code for the Hello World demonstration project.")
  • Website - Add a URL if the project has an associated website
  • Topics - Add topic tags separated by spaces to help others find the repository

Under the Include in the home page section, configure which items appear on the repository home page. These are my preferred settings:

  • Releases
  • Deployments
  • Packages

Click Save Changes when done.

Adding a social preview

Adding a social preview image customizes the image shown when the repository is shared on social media. Go to Settings and find the Social preview section:

  1. Click Edit under Social preview
  2. Upload an image - images should be at least 640x320 pixels (1280x640 pixels for best display)
  3. Save the changes

Configuring repository features

Configuring repository features controls which GitHub features are available for the repository. Go to Settings > General and scroll to the Features section. These are my preferred settings for a new repository:

  • Wikis and enable Restrict editing to collaborators only
  • Issues
  • Sponsorships
  • Preserve this repository
  • Discussions
  • Projects
  • Pull requests

Setting up the wiki

Setting up the wiki gives you a place to write documentation alongside your code. After enabling Wikis in the repository settings:

  1. Click the Wiki tab on the repository page
  2. Click Create the first page - GitHub creates a default Home page
  3. Edit the page content as needed
  4. Set the edit message to describe the initial commit (e.g., "Initial commit")
  5. Click Save page

To work with wiki pages locally, copy the clone URL from the wiki sidebar. The wiki is a separate Git repository with .wiki.git appended to the repository URL (e.g., https://github.com/dotjesper/hello-world.wiki.git).

Initializing Git in a standalone folder

Not every project starts on GitHub. Sometimes you already have a folder with scripts, configuration files, or documentation on your local machine, and you want to start tracking changes with Git. Instead of creating a repository on GitHub first, you can initialize Git directly in an existing folder.

The folder does not need to be empty. Git can be initialized in a folder that already contains files - scripts, configuration files, documentation, or any other content. Existing files are not modified or removed when Git is initialized. They simply become untracked files that you can then stage and commit.

When to use git init

Initializing Git locally makes sense when you already have files you want to track, when you want to experiment with Git before publishing anything, or when you simply prefer to start locally and push to GitHub later.

Step-by-step guide using Visual Studio Code

Follow these steps to initialize Git in a standalone folder using the Visual Studio Code interface:

  1. Open Visual Studio Code and select File > Open Folder to open the folder you want to track
  2. Click the Source Control icon in the Activity Bar (or press Ctrl+Shift+G)
  3. Click Initialize Repository - Visual Studio Code creates a hidden .git folder and the folder is now a Git repository
  4. All existing files appear in the Changes list as untracked files
  5. Click the + icon next to Changes to stage all files, or click the + icon next to individual files to stage them selectively
  6. Enter a commit message (e.g., "Initial commit") in the message box and click Commit

Step-by-step guide using the terminal

Follow these steps to initialize Git in a standalone folder using the terminal in Visual Studio Code:

  1. Open Visual Studio Code and select File > Open Folder to open the folder you want to track
  2. Open the terminal in Visual Studio Code by selecting Terminal > New Terminal
  3. Run the following command to initialize a new Git repository in the folder:
git init
  1. Git creates a hidden .git folder that tracks all changes - the folder is now a Git repository
  2. Stage all existing files by running:
git add .
  1. Create the first commit:
git commit -m "Initial commit"

Both approaches produce the same result - a fully functional local Git repository. You can stage changes, commit updates, and view history - all without a GitHub connection.

Connecting to GitHub

Connecting a local repository to GitHub lets you back up your work, collaborate, and access your files from anywhere. To push your local repository to GitHub:

  1. Create a new repository on GitHub following the steps in the Creating a GitHub repository section - do not check Add a README file or any other initialization options, since you already have local content
  2. Copy the repository URL from GitHub
  3. Add the GitHub repository as a remote:
git remote add origin https://github.com/your-username/your-repository.git
  1. Push your local commits to GitHub:
git push -u origin main

After pushing, the local folder and the GitHub repository are connected. From this point, the daily workflow is the same as any cloned repository - pull, stage, commit, push - as described in Part 4 Branching and Workflows.

Useful references

These resources provide further reading on the topics covered on this page:


Page revised: March 9, 2026

Home

Part 1 Getting Started

This first part of the guide focuses on getting started with GitHub, Git, and Visual Studio Code. It covers the reasons for using these tools, what you need before you start, how to install and set up Visual Studio Code and Git, configuring Git, and useful references for further learning.

Introduction

Why GitHub, Git and Visual Studio Code

What you need before you start

Installing Visual Studio Code and Git

Setting up Visual Studio Code

Configuring Git

Useful references

Part 2 Creating a Repository

Part 2 focuses on creating a repository, including how to create a GitHub repository, initializing Git in a standalone folder, and useful references for further learning.

Creating a GitHub repository

Initializing Git in a standalone folder

Useful references

Part 3 Repository Essentials

Part 3 covers the essentials of working with repositories, including learning Markdown, common repository files, community health files, writing good commit messages, common scenarios for IT professionals, and useful references for further learning.

Learning Markdown

Common repository files

Community health files

Writing good commit messages

Common scenarios for IT professionals

Useful references

Part 4 Branching and Workflows

Part 4 delves into branching and workflows in Git. It covers the basics of Git branches, how to clone a repository, using multi-root workspaces in Visual Studio Code, working with branches, and the daily Git workflow. It also includes useful references for further learning.

Cloning a repository

Using multi-root workspaces

Working with branches

The daily Git workflow

Useful references

Part 5 Working With Repositories

Part 5 focuses on working with repositories, including understanding GitHub URLs, downloading files from GitHub using PowerShell, referencing files in a repository, and the differences between public and private repositories. It also includes sample scripts, an alternative using GitHub Gist, and useful references for further learning.

Understanding GitHub URLs

Downloading files from GitHub using PowerShell

Referencing files in a repository

Public vs. private repositories

Sample scripts

GitHub Gist as an alternative

Useful references

Part 6 AI as a Learning Companion

Part 6 explores how to use AI, specifically GitHub Copilot, as a learning companion to enhance your coding experience. It covers the basics of Vibe Coding, how to get started with GitHub Copilot, and practical tips for writing effective prompts and validating AI-generated code. It also includes guidelines for using AI-assisted coding and references for further learning.

What is Vibe Coding?

Getting started with GitHub Copilot

Your first Copilot conversation

Writing effective prompts

Generating and understanding a script

Learning a new concept through AI

Validating AI-generated code

Using logs and AI to troubleshoot and optimize

Guidelines for AI-assisted coding

Useful references

Part 7 Copilot Configuration

Part 7 focuses on configuring GitHub Copilot to enhance your coding experience. It covers how to create and use copilot-instructions.md files to provide context and guidance to Copilot, as well as best practices for sharing instructions across repositories.

Adding copilot-instructions.md to your repository

Sharing instructions across repositories

Useful references

Part 8 Field Notes

Part 8 is a collection of field notes, which are practical insights and tips that I've gathered through my experience working with GitHub, Git, Visual Studio Code, and GitHub Copilot. These notes are meant to provide additional context and guidance on specific topics that may not have been covered in depth in the previous parts.

Extension recommendations in multi-root workspaces

Copilot instructions and the GitHub Wiki sidebar

GitHub Wiki does not support branch switching

Launching Windows Sandbox from Visual Studio Code

Mirroring wiki pages into the main repository

Useful references

Part 9 Exercises

This is the exercises section! This is where you can apply what you've learned in the previous parts through practical exercises. Each exercise is designed to reinforce key concepts and skills related to GitHub, Git, and Visual Studio Code.

Prerequisites

Part 1 - Getting started

Part 2 - Creating a repository

Part 3 - Repository essentials

Part 4 - Branching and workflows

Part 5 - Working with repositories

Part 6 - AI as a learning companion

Part 7 - Copilot configuration

What to do next

Useful references

Revision

Clone this wiki locally