DEV Community

Cover image for How to create a Unique Git repo: A Step By Step Guide.
Alexandra Oyoh Alison
Alexandra Oyoh Alison

Posted on • Edited on

How to create a Unique Git repo: A Step By Step Guide.

In my previous post, I explained what Git and GitHub are and how they vary. In this post, I'll show you how to create a unique repository, popularly known as a repo on GitHub.

Git tells you that for every project you create, you need to maintain a unique repo.

what is a repo?

Think of a repo as a secure bank vault. It's a place to store and safeguard your valuable code and its history. In this vault (repo), your code files are protected and managed within it. just as a bank vault is where you keep your money and track its history.

How to create a unique Git Repo?

  • The first thing you want to do is to log in to your GitHub account on any web browser of your choice. It'd bring you to your GitHub dashboard.

GitHub dashboard

  • The next thing you want to do is to click on create a new repository 👇

New Repository

  • Type a short, memorable name for your repository. For example, "My Git Repo."

git repo name

  • You can add a description of your repository if you want to. It's totally up to you. For example, you can just add "my first git repo."

git repo description

  • You can make your repository public or private. If you choose to make it public, your repository will be open to everyone, and you will have control over who can commit. You, on the other hand, can make it private.

That is, you have control over who may see and commit to your repository.

Furthermore, you would be required to pay a monthly fee.

However, since you're just starting, I recommend that you make it public so that you can share your project with everyone and they can see what you've worked on.

Git repo public/private

  • The next thing you want to do after that is to initialize your repository with a README file. This is where you have the liberty to write a long description for you project.

initialization of readmefile

  • After that, you have the option to add gitignore. There might be some files you don't want when you're making operations like push or pull. You don't want those files to get pushed or pulled. You can add those files in gitignore. Since you're just starting, you can just ignore.

gitignore option

  • After that, the final step will be to click on create repository.

create a repo

Yaay!

You've created your unique Git repo.

At the bottom of the resulting Quick Setup page, under "Import code from an old repository", you can choose to import a project to your new repository. To do so, click Import code.

conclusion

In this guide, we've explored the concept of a Git repository and how to create a unique one on GitHub.

Just like a secure bank vault protects and manages your money, a Git repository serves as a digital vault for your valuable code and its history.

We've walked through the steps of creating a repository on GitHub, from choosing a memorable name and optional description to deciding on its visibility (public or private).

Initializing the repository with a README file and setting up a .gitignore file for excluding specific files during operations like push and pull are also essential steps.

By following these simple steps, you've successfully created your very own Git repository, laying the foundation for version control and collaboration on your coding projects.

Now, you're ready to embark on your coding journey with a safe and organized place to store your code.

Happy coding, techie! 🤭

Top comments (0)