Create GitHub/Gitlab Repository From CMD?

For Gitlab : use the below command from the locally created git repository.

for ssh : git push –set-upstream git@gitlab.com:username/project-name.git master

for https : git push –set-upstream https://gitlab.com/username/project-name.git master

For Github: It’s a two way process

step 1: Download and install hub, for that we need to download scoop in windows and through that we can download hub open the powershell in windows and type the following command :

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') 
        or 
iwr -useb get.scoop.sh | iex

Once scoop is installed successfully, run the following command

scoop install hub

it will install the hub in your system and will automatically configure the path variable so you don’t need to do anything.

Step 2: navigate to your locally created git repository for which you want to create the remote repository and run the following command

hub create

It will ask for username and password, configure it properly and hub will create the repository for you.

Happy coding :)-

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *