Gitea Development

Gitea provides the easiest and fastest way of making changes in your source code, bringing all of git’s functionalities, and pairs it with a visually easy interface right in your browser.

It resembles the Github development platform, and additionally, it allows you to keep track of your remote repositories, as well.

How to sign in

To sign in, simply access the https://git.presslabs.net/user/login link and enter your Presslabs account credentials.

null

Learn more about Gitea

null

On the left side of the dashboard, you can see the changes that have been made, and on the right side, you can find a list of all your repositories (sites).

Accessing one of your sites will take you to its corresponding repository, as seen below.

null

Here you can see your site’s source code, and you have the possibility to make changes. The source code can be found in the Code section.

You can add a new file by clicking the New file button, and you also have the possibility of uploading a new file by clicking the Upload file button.

In case you know git commands and want to work from the command line, you can clone your instance’s repository locally through ssh or https, using the links provided in the top right side of the window. In order to have the right to download an instance, you need to be a collaborator on the repository and this can be set in the Presslabs Dashboard, Collaborators Section of each site.

You also have the possibility to download the repository using the Download this repository button.

You can also see all the commits made on this repository by clicking on the number of Commits (50 Commits in the screenshot below) and if you click on them, it will show their details.

null

How to commit changes

Let’s say you want to add the file ads.txt, which is now required by most Ad Networks. First of all, it’s important to know where to place the files, in order to show up in the root of your domain, e.g. example.com/ads.txt. The correct path for these files is:

/wp-content/root/

and in order to add a new file here, you need to click on New file from the right side:

null

Then you need to type the name of the file (in our case, ads.txt) and enter the content, similar with the test content I added for this file:

null

When you are finished with the modifications, you need to save them. In order to do that, at the bottom of the page, there is a Commit Changes button you need to press:

null

You can also add a custom message to your commit, and an extended description in the text-boxes shown above the Commit Changes button. Otherwise, the commit will be saved with the default message that is displayed.

null

Now let’s edit this file, as you want to do some changes to your ads.txt file. For this, you need to navigate again to /wp-content/root/ and click on the file you want to edit (ads.txt, in our case), then click on the edit button in the right side of the screen as seen below.

null

You can make your changes inside the editor.

null

Next, you can commit the changes just like we did when adding the file, using the Commit changes button.

After saving the changes, you can see the commit by pressing the History link, which can be found near the Edit this file button.

null

Above you can see a list of all the commits made for that specific file (ads.txt). By clicking the SHA of a commit, you can see all the changes that have been made, as well as their author, and the total number of lines that have been added (with green) or removed (with red).

null

Below you can see the Unified view of the changes made, and by clicking the Split View button you can see them separated.

null

Now you can navigate and check the file you just edited, at example.com/ads.txt.

How to move a file to another directory

For example, let’s say you have a robots.txt file in your repository. As you can see, it is not where it should be, which is in /wp-content/root/ directory. In order to move it, you need to modify its path.

Go to the file you want to move and click the Edit this file button.

null

As you can see, now you can modify the path. As I have mentioned before, the robots.txt file should be in /wp-content/root/ so I will write exactly this path: /wp-content/root/robots.txt. Notice that every time you press /, the directory will become part of the path marked with blue font, and in order to go back and modify this path simply press the backspace taste.

null

Now click the Commit Changes button and you can check that the robots.txt file is now situated in /wp-content/root/.

null

How to remove a file or a directory

null

To remove a directory, you need to remove all its files, after which it will disappear automatically.