Using Git within a Workspace with a Linux VM

Users can create Git repositories completely private and local to their workspace to facilitate collaborative code development and document version control. This is provided through the use of the Open Source tool ‘Gitea’. Full documentation on Gitea can be found at: https://gitea.io

Creating a repository and managing files, branches and pull requests can all be achieved using the Gitea web portal. To access the web portal, when within a Linux Virtual Machine, open the browser and navigate to:

https://gitea.<workspace_domain_url>

Below you can see a screenshot of the Gitea web portal home page within a demo workspace environment with a URL, for example: https://my-workspace-name.aregion.aridhia.io

In this example, my-workspace-name is the name of the workspace and aregion.aridhia.io is the domain of the workspace.

The full Gitea web portal address in this case is https://gitea.uksouth.preview.aridhia.io

Gitea Web Portal.png

There can only be one Organization and that Organization has the name of the workspace.

Gitea Organization.png

All members of the workspace will be members of the Organization and will have the facility to create repositories, clone repositories and work with Gitea as they would expect. To create a new repository, from the Organization page, select ‘New Repository’.

Gitea New Repository.png

When doing so, the user has a number of options. For example, the repository could be created as a template or be based on a template.

Gitea New Repository Dialogue.png

Upon creation of the repository, instructions are provided on how to clone the repository. This requires terminal access. Open a Linux terminal and type:

git clone <repo>

where <repo> is the long form name of the repo as provided by the Gitea UI. You can copy the repo name directly from the UI using the ‘copy url’ button as shown below.

Gitea Clone Repository.png

It is recommended for performance and compatibility purposes the user clones this repo in a dedicated directory within their home file environment.

For example: /home/scott.russell_7b2alc0

cd
    
mkdir ./git
    
cd git
    
git clone git@gitea.uksouth.preview.aridhia.io:sr-demo/demo_4.git

At this stage, the repo is completely empty. At least a single file must be added to the cloned repo. Users of Git will be familiar with the CLI required to commit a file to the master branch.

git add <file>
    
git commit -m ‘<comment>’
    
git push origin master

On completion of these steps the user can work with files within the repo using the Gitea UI or the expected Git CLI commands.

Gitea Final View Update.png

Full documentation on Gitea can be found at https://gitea.io.

Updated on October 30, 2024

Was this article helpful?