Hi friends,
let's say you want to create a new Repo in your terminal and push it to your Github, here is the steps to do that:
1.convert your directory to a git repo with the command :
git init
2.stage your files, so you can commit them
git add .
or optionally you can select a file name by:
git add file_name/s
3.you need to authorize your github cli if you haven't already , I use ** gh ** for that, you can download it first if you don't have it (sudo apt install gh) in Debian Distros
gh auth login
just follow the instruction to complete the authentication steps
4.finally :) , create the new repo
using ** gh ** again with options ** gh repo create**
gh repo create newrepo_name --public --source=. --remote=upstream --push
newrepo_name == the repo name you want to be on github
--public == make the new repo public, you can use "--private"
--source == path to local repo to use as source
--push == Push local commits to the new repository
I hope you enjoyed this tutorial :)
Thanks !
Top comments (0)