One common way of creating a remote repository is by visiting a website such as GitHub, GitLab, Bitbucket etc., and using the browser to create the remote repository. An alternative way is to use the terminal. In this tutorial, we're going to learn how to create a remote repository from the terminal using GitLab. Creating a remote repository directly from the terminal seems faster and more efficient in my opinion. If you would like to follow along, you will need a git installed on your machine, GitLab account and some familiarity with using the Git, free open source, version control system. To get started visit https://gitlab.com and click on register. You can also check Episodes 8 and 9 and also my blog post on Version Control with Git. While all these focus on GitHub, the same concepts can be applied to other other software development platforms after making a few minor tweaks to the code here and there where necessary. In this tutorial, we're going to create our remote repository without having to leave the terminal.
Create a folder for your application.
$ mkdir public_health
Inter into your project direcotry.
$ cd public_health
Create a REAME file.
$ echo "**Name: Kudzai Nyandoro**" >> README.md
Double check the content of your README file.
$ cat README.md
Create a file for our application.
$ vim app.py
Add code to the
#app.py print("Welcome To The Public Health App!")
$ git init
Add all your files and folder to version control.
$ git add -A
Write your initial commit message.
$ git commit -m "Initial commit"
Create your remote repository locally and push to GitLab.
$ git push --set-upstream email@example.com:kcny/public_health.git master
Configure the remote.
$ git remote add origin firstname.lastname@example.org:kcny/public_health.git