Generating to a Repository

On this page, you will find the necessary configuration steps to start generating files to a repository. You can use the version control repository that best suits your needs; however, in this documentation, we use GitHub and GitLab as examples.

When you generate to a repository, you can pull the changes to a local repository whenever you want, making web development more efficient and faster.

We recommend using this feature every time you are developing.

Content

GenioWeb definition

In the Settings menu, you should activate the Git Integration after generation option.

  • This action will open the section to add repository configurations. If you already have a repository, add the URL, the branch name (it can be the main), the username, and the token.
  • After that, you can generate the application in the Code Generation menu.
  • After generation, you can simply pull the code for your local repository.

git_genioweb.png

Why use a Repository?

A code repository, often referred to as a version control repository, is a place where you can store and manage your source code files and track changes made to them over time. It allows multiple developers to collaborate on a project, keep track of changes, and revert to previous versions if needed.

The most popular tool for managing code repositories is Git, and there are several platforms where you can create a Git repository:

  • GitHub(https://github.com/): GitHub is one of the most widely used platforms for hosting Git repositories. It offers a user-friendly interface, collaboration features, issue tracking, and integration with various development tools.
  • GitLab(https://about.gitlab.com/): GitLab is similar to GitHub and offers features like issue tracking, CI/CD pipelines, and built-in code review tools. It also provides options for self-hosting if you prefer to host your repositories on your own servers.
  • Between others.

These platforms provide web-based interfaces for managing repositories, but you can also interact with them using Git command-line tools or desktop applications like GitHub Desktop, GitKraken, or Sourcetree.

Registration

You can create an account on your preferred repository platform. Whether it's Git, GitLab, or another platform you're more familiar with.

github-registration.png gitbal-registration

After creating your account, please make sure you have a personal access token. You'll need it to configure the repository in the GenioWeb project.

Note: You can use the same token for different projects. {.is-info}

Create a token

GitHub

In GitHub, click on the avatar of your profile, then select "Settings".

github_peferences.pnggithub_sidebar.png

  • In the left sidebar, select the "Developer settings" menu.
    1. Navigate to "Personal access tokens" -> "Tokens (classic)".
    2. Click on the "Generate new token (classic)" button.

github_token_option.png

  1. Provide a name for your token and set an expiration date.
  2. Then, select the options that best fit your project's needs—consider including at least all repository options.
  3. After configuring the options, create the personal access token.
  4. Upon clicking the button, your token will appear on the screen.

    Ensure you save it, as you won't be able to access it again. {.is-warning}

github_token.png

Gitlab

In GitLab, click on the avatar of your profile and then select "Preferences".

gitlab_preferences.png

  • In the left sidebar, select the "Access tokens" menu.
    1. Provide a name for your token and set an expiration date.
    2. Then, choose the appropriate options that best fit your project's needs—you can select all options.
    3. Afterward, create the personal access token.
    4. Upon clicking the button, your token will appear on the screen.

      Ensure you save it, as you won't be able to access it again. {.is-warning}

gitlab_token.png

Create a repository

GitHub or GitLab

To create a repository on GitHub or GitLab, start by adding a new repository using the plus sign located in the upper left corner.

github_newrep.pnggitlab_newrep.png

During the creation process, you can define several settings, but for Genio projects, you can leave everything as default. However, we recommend creating a private repository and adding a README file. This last action will insert the first commit after the repository creation.

github_newproject.pnggitlab_newproject.png

Visual Studio

Visual Studio allows you to connect with your GitHub/GitLab credentials. To do this, you can click on the Git menu, and then select "Create Git Repository".

vs_newrep.png

You can configure different options in the sidebar on the left to select the repository type. In this documentation, we will describe the GitHub option. Under this option, you have two sections: "Initialize a local Git repository" and "Create a new GitHub repository".

For Genio projects, the following configurations are recommended:

Initialize a local Git repository:

  1. Define the local path.
  2. You don’t need to add a .gitignore file.
  3. You don’t need to add a License template.
  4. At the end, add a README file (this action will insert the first commit after the repository creation).

Create a new GitHub repository:

  1. Configure the local path, your Git account, and select the owner.
  2. Give a name to your repository and select the "Private repository" option (as recommended).
  3. At the end, you will have the URL of the new repository.

vs_newproject.png

Clone repository

To clone your repository, you have multiple options. Here are two common methods: via Visual Studio and through command line.

Visual studio

Go to visual studio, Git menu and select "Clone Repository..."

vs_clone.png

Depending on the type of repository and the configurations you've set up, you can find your repository in Visual Studio. Once you locate it, simply select the one you want to clone and click on the "Clone" button.

vs_clonerep.png

Command Line:

To clone a repository via command line, navigate to the local path where you want the local repository to be located. Then, open a command prompt window and type the following command:

git clone <repository_url> <repository_folder_name:optional>`

For example:

git clone https://github.com/account_example/example_repo repository01

If you don’t specify a folder name, Git will use the repository's original name.

Pull repository

Visual Studio

Start by opening one of the Genio solutions, WebAdmin, or the application. When you are already in the context of the local repository, you can go to the Git menu and click on "Pull".

vs_pull.png

Command line

Navigate inside the local repository directory, then open a command prompt window and type:

git pull

Final notes

After pulling the latest changes, all you need to do is compile the code, and you'll have the new updates seamlessly integrated into your project! {.is-success}