Three Ways to Set Up a New GitHub Repo

Chris DiStasio
4 min readApr 30, 2023
Photo by Diego PH on Unsplash

Whether you’re new to using GitHub for software development or you’re a repo-making machine, you should aim for setting up your new local repo and hooking it up to the Octocat’s lair in the most efficient way possible.

Starting from the fastest way and ending up in the most thorough and instructive ways. here are three ways to get to the same place in your daily programming journey.

Method 1: The Quick and Dirty

Step 1: Make a new repo by clicking on the + symbol to the top right of your GitHub account or go to https://github.com/new.

Step 2: Name the repo and then just click on the Create Repository button (do not check any of the boxes/select anything after you’ve made the name… just click on the Create Repository button).

(Explanation for beginners: The README.md, .gitignore, and license can be added later easily, and you’ll probably want to customize the README.md and the .gitignore files yourself in a professional or extensive student project, anyway. Not checking the boxes makes a clean slate that takes less steps to get your remote GitHub project set up and connected locally.)

Step 3: On the instruction page that comes up, there’s no green Code button to click but do click on the copy symbol to the right of the field that has your repo url (in the window that says “Quick setup — if you’ve done this kind of thing before”). You will use this url to clone as you would usually do when (forking and) cloning a repo that’s already made.

Step 4: Through your terminal, go into the desired project folder through your terminal, type “git clone ” then paste the url you copied and click “Enter”.

(Warning for Beginners: Do NOT make a new directory (folder) for a repo you are forking/cloning. It’s easy to think you should do that, especially when you’re new to git and GitHub. When you clone a repo into VSCode, it creates its own directory! If you make your own directory, it will get confusing about which folder you are in and could create annoying git-related issues.)

Step 5: cd into the directory you just cloned

Step 6: Copy the instructions under “…or create a new repository on the command line” on the GitHub page

Step 7: Paste all of the instructions in a terminal and hit return to push. Ignore any errors and warnings you see along the way.

Step 8: Go to your GitHub repo and refresh the page to see your new repo file/s!

(Explanation: The README.md, .gitignore, and license can be added later easily, and you’ll probably want to customize the README.md and the .gitignore files yourself in a professional or extensive student project, anyway. Not checking the boxes makes a clean slate that takes less steps to get your remote GitHub project set up and connected locally.) (Because you’re choosing the second option, of starting in VSCode on your local file system, you should make at least the README.md and perhaps the .gitignore file in VSCode then add them with “git add .”, as the instructions below direct you.)

Method 2: Making a Repo from the Command Line in your IDE/Code Editor

(This method lets you make a repo locally, from your computer’s own file system.)

Step 1: Make a new repo by clicking on the + symbol to the top right of your GitHub account or go to https://github.com/new.

Step 2: Name the repo and then just click on the Create Repository button (do NOT check any of the boxes/select anything after you’ve made the name… just click on the Create Repository button).

Step 3: Through a terminal in your IDE, go into the folder you keep for assignments on your computer.

Step 4: Make a directory with the same name as the name of the repo you made on GitHub.

Step 5: cd into the directory.

Step 6: Type “git init”. You’ll see that you’ve made a git repository.

Step 7: Make a README.md file.

Step 8: Make a .gitignore file if your project needs one.

Step 9: (Optional) Make any other basic kinds of files with boilerplate you need to make (such as index.html)

Step 10: Back on GitHub, on the instruction page that came up when you created the repo, click on the copy symbol to the right of the field that has your repo url (in the window that says “…or push an existing repository from the command line”).

Step 11: Paste the copied part in your terminal and click on “Enter” to push your new code to the repo you made on GitHub.

Step 12: Go to your GitHub repo and refresh the page to see your new repo!

(Note for beginners: It’s not as quick, but it’s not a bad idea to type out the copied lines yourself instead of just copy/pasting them (except your long url). In this way you can get used to the git commands and steps involved, which are very common ones you’ll use on the job.

Method 3: Using GitHub Desktop

For making and using repos, you can also use Github Desktop: https://desktop.github.com/. Follow the directions at this website to download, install and use this very helpful tool. It can make a lot of common version control tasks simpler.

(Note for beginners): GitHub Desktop makes it easier to do some git-related actions, but you should ideally know how to do the same actions through a terminal command line and be able to use GitHub’s website for some of the actions, too. GitHub Desktop can be a useful tool but it’s not widely used on the job in the industry.)

--

--

Chris DiStasio

Full stack web developer and instructor with a passion for creating an effective and intuitive user experience as well as helping others do the same.