Create and Clone a Repo in Github on Ubuntu 18.04

Reading Time: 2 minutesGitHub is a free repository hosting service, used as version control for web developers to download and push their code from their servers to other users.  In our previous article we’ve instructed on how to add Git to your Ubuntu VPS server. We’ll continue on and show you how to add and clone a repo from GitHub to your server. Pre-flight  

Step 1: GitHub Account Setup

If you haven’t done so already, make a account, it’s free! This is where you’ll be creating a repo and putting in files.  Once you’re in your HubSpot account, click Create a repository (or New Repository), which will take you to a page where you can add details for your repo.  

Step 2: Create Repo via Browser

Fill out the details for your repo and be sure to take note your repo name, you’ll need it later in this tutorial.  If you are curious about the options on this screen, the README file is common for writing instructions to your users.  The licensing option can seem confusing but if you are questioning which one to choose you can check out this site to guide you. Once all details are in, click Create repository. You can create a repo in by filling out this form. Once created, you’ll see two files in your repository if you chose the licensing and README file.  

Step 3: Configuring Git per User

After installing Git, configuration is needed for commit messages to be sent out.  Without setting the name and email address you’ll see warnings when making commitments to git. If you have multiple user who utilize git, make an entry for each user. You can easily set these details for a user with two commands within your server’s terminal. (If you need to access the information set you can find it in the .gitconfig file.)
If you already have a account you can use the associated username and email.
git config --global "Your_Name" git config --global ""    

Step 4: Create A Directory

When you create a directory, you can use this space to sync newly written/edited code to your GitHub account. I’m going to call this environment git_environment and move into the directory using the cd command. mkdir git_environment cd git_environment  

Step 5: Copy your GitHub URL

First, its necessary to clone or download our already pre-existing README and licensing file from our GitHub account.  Jump back to your GitHub account, click Clone or download and copy your GitHub link.The Github url can be found by clicking the Clone or download button.  

Step 6: Clone your Repo

In your terminal, you should find yourself in the GitHub directory.  We will first clone our repo with our copied GitHub URL and then change directories to our project name. git clone cd want-some-java By listing the want-some-java directory, you’ll see the two files in your repo, verifying that the cloning has worked. ls Example Output:LICENSE In our next tutorial, where will teach you how to edit/create a file on your server and push the script to your GitHub account.  

Author Bio

About the Author: Echo Diaz

Throughout Echo's four year stint as a technical support specialist, her passion for breaking down complex concepts has to lead to a career in professional writing. As a top tier support specialist, she adds a distinctive element to her written work that speaks to customer feedback and concerns.

Echo occasionally pops her head out from behind her computer to watch her dog energetically run around the yard and unabashedly shovels money into buying tickets to see her favorite musical artists.

Refer a friend and get hosting credit!