Hi Friend!
Today I wanna share with you how I quickly create new repositories on GitHub just using my Terminal.
If you didn’t know, GitHub has a CLI, that enable you to create and manipulate your repositories. Which make your life easier when you are creating new repositories for your projects, prototypes and POCs. You can Install here.
Once you install the CLI follow the steps below to create a new repository.
01 – First, initialize Git:
git init02 – Second, create a new branch called main:
git checkout -b main03 – Now create a new repository using the gh command.
gh repo create repo-name --public --source=. --remote=origin- The flag
--remotedefines the origin name for the repository - The flag
--sourcedefines the path/folder for the repository - The flag
--publicmakes the repository public
04 – Once you create the repository, add all files to staged:
git add .05 – Now create your first commit:
git commit -m "feat: add initial files"06 – And push all your updates to the main branch:
git push -u origin main07 – Now to see if it worked it properly, try to access the repository:
gh browseGreat! You did it! You just created a repository via terminal.