-
Notifications
You must be signed in to change notification settings - Fork 0
Part 2 Creating a Repository
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 repository on GitHub gives you a central place to store and share your files, scripts, and documentation.
Follow these steps to create a new repository on GitHub:
- Go to GitHub and sign in with your account
- Click the + icon in the top-right corner and select New repository
- Enter a repository name - use lowercase with hyphens (e.g.,
my-scripts) - Add a description that explains the purpose of the repository
- Choose Public or Private visibility
- Check Add a README file to create an initial README.md
- Optionally add a
.gitignoretemplate and a.LICENSEfile - Click Create repository
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 image customizes the image shown when the repository is shared on social media. Go to Settings and find the Social preview section:
- Click Edit under Social preview
- Upload an image - images should be at least 640x320 pixels (1280x640 pixels for best display)
- Save the changes
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 gives you a place to write documentation alongside your code. After enabling Wikis in the repository settings:
- Click the Wiki tab on the repository page
- Click Create the first page - GitHub creates a default Home page
- Edit the page content as needed
- Set the edit message to describe the initial commit (e.g., "Initial commit")
- 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).
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.
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.
Follow these steps to initialize Git in a standalone folder using the Visual Studio Code interface:
- Open Visual Studio Code and select File > Open Folder to open the folder you want to track
- Click the Source Control icon in the Activity Bar (or press Ctrl+Shift+G)
- Click Initialize Repository - Visual Studio Code creates a hidden
.gitfolder and the folder is now a Git repository - All existing files appear in the Changes list as untracked files
- Click the + icon next to Changes to stage all files, or click the + icon next to individual files to stage them selectively
- Enter a commit message (e.g., "Initial commit") in the message box and click Commit
Follow these steps to initialize Git in a standalone folder using the terminal in Visual Studio Code:
- Open Visual Studio Code and select File > Open Folder to open the folder you want to track
- Open the terminal in Visual Studio Code by selecting Terminal > New Terminal
- Run the following command to initialize a new Git repository in the folder:
git init- Git creates a hidden
.gitfolder that tracks all changes - the folder is now a Git repository - Stage all existing files by running:
git add .- 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 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:
- 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
- Copy the repository URL from GitHub
- Add the GitHub repository as a remote:
git remote add origin https://github.com/your-username/your-repository.git- Push your local commits to GitHub:
git push -u origin mainAfter 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.
These resources provide further reading on the topics covered on this page:
- How to set up a well-configured repository - A detailed guide on repository configuration best practices
- Adding or editing wiki pages - GitHub documentation on working with wikis
- GitHub Documentation - Official documentation for GitHub features
- About repositories - Understanding repository visibility and settings
Page revised: March 9, 2026
This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
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.
Why GitHub, Git and Visual Studio Code
What you need before you start
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.
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.
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.
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.
Downloading files from GitHub using PowerShell
Referencing files in a repository
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.
Getting started with GitHub Copilot
Your first Copilot conversation
Generating and understanding a script
Learning a new concept through AI
Using logs and AI to troubleshoot and optimize
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
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
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.
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