To create a Git repository on GitHub, go to github.com and signup for an account. It’s free. After you’re logged in to your account, navigate to the “Repositories” tab by following this URL: https://github.com/your_username?tab=repositories and click the button “New” (as you see in the screenshot below).
In the next window, type your desired repository name in the “Repository name” field. Make sure it’s unique and there is no space.
And make this name exactly as you named the project on your local machine (computer).
You can leave the rest of the fields as they are. All the default options are okay. And hit the button “Create repository” at the very bottom of the page.
That’s all you need to create a Git repository on GitHub. Note that Git does not equal GitHub. If you wish, see their main differences.
Once it has been created, you’ll see an instruction to connect this repository with your local repo/project (as you see in the screenshot below).
That’s it! See how you can connect your local project with this remote repository.
To change this remote origin URL in the future or push your project to a different repository, see this post that will show you how to do it properly. Most time you don’t need to change the origin URL but if you clone a repository from GitHub, Bitbucket, or somewhere else, you’ll need to change it.
Now you know how to create a brand-new repository. But in some cases, you may need to clone an existing repository. For example, if you’re going to work with a team or collaborate or if you want to take someone else’s project & modify it. To learn how to clone a Git repository, see this post.
Git is super helpful when it comes to tracking changes, collaboration, fixing issues, and much more. Some of you may think that Git is only useful for teams, but it’s not the case. It’s also beneficial for individuals who work alone.
And GitHub is one of many popular services that host your projects. Also, there are some alternatives to GitHub such as Bitbucket, GitLab, etc. You can check more alternatives to GitHub on another website.
One of the cool features of GitHub is “Pages.” You can create a static website or page directly from your repository. To learn more about GitHub Pages, see this post.
Learn more about Git
- What is Git and why it is used?
- How to install Git on Windows & Mac?
- How to use Git with Visual Studio Code?
- How to use Git and GitHub?
- What is the difference between Git and GitHub?
- How to connect local Git to a remote server?
- How to change Git remote origin URL?
- How to create a Git repository on GitHub?
- Git add all (stage all changes)
- How to undo the git add -A command?
- How to undo the last Git commit?
- How to change the git commit message?
- How to remove or unstage a file from Git commit?
- How to git push after rebase?
- Git switch branches: How to checkout the git branch?
- How to merge a git branch to master?
- Git branch: create, checkout, merge, list, command, delete & push
- How to clone a Git repository?
- How to git pull to override the local project?
- How to remove file from Git?
- When should you use git rebase?
- Git commands & explanation (downloadable cheatsheet included)
- How to create GitHub Pages?
Now you know how to create a repository on GitHub. Next, you need to connect your local project to this new repository that you have created just a moment from now. See how you can use Git & GitHub.
If you want to learn more about Git, check out the following posts:
And if you have any questions, let me know in the comment.