Home  >  Article  >  Development Tools  >  How to create and run projects on gitee

How to create and run projects on gitee

PHPz
PHPzOriginal
2023-03-31 09:03:333343browse

Gitee is a well-known code hosting platform in China and has become the tool of choice for many developers and teams. Creating and running projects on Gitee is a need of many developers. This article will introduce how the Gitee project works.

Step One: Create a Project

First, you need to create a project on Gitee. Go to the Gitee website homepage, click the "plus" button in the upper right corner, and then select "New Warehouse".

On the page of creating a new warehouse, fill in the project name, description and other information, and then click "Create Warehouse" to create a new project.

Step 2: Upload the code

After creating the project, you need to upload the code to Gitee. Click the "Upload File" button, then select the directory where your project is located, and upload the code files to the Gitee repository.

When uploading code, you can choose to use the Web IDE tool or Git tool provided by Gitee to upload code. If you use the Git tool to upload, you need to install the Git client on your computer first and configure the SSH public and private keys.

Step 3: Run the project

After uploading the code, you can run your project on Gitee. Gitee supports multiple programming languages ​​and runtimes. The following takes the Java language as an example to introduce how to run a Java project on Gitee:

  1. On the project homepage, click the "Actions" button, and then click the "New workflow file" button.
  2. Create a running script, for example:
name: Run Java Project

on:
  push:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build with Gradle
      run: ./gradlew build
    - name: Run tests with Gradle
      run: ./gradlew test
    - name: Run Application
      run: java -jar build/libs/*.jar
  1. Save the running script as a "main.yaml" file and upload it to the Gitee repository.
  2. Click the "Actions" button, then click the "Run workflow" button, select the "main.yaml" file and click the "Run workflow" button to run your Java project.

It should be noted that different programming languages ​​and running methods require different running scripts to run the project. You can find the corresponding script on Gitee, modify it and run it. In addition, Gitee also provides services such as online compilation, building and deployment, which can be used on demand.

Summary:

This article introduces how to create and run projects on Gitee. With these simple steps, you can easily create your own project and run it on Gitee. As a programmer, mastering how to use Gitee is an essential skill.

The above is the detailed content of How to create and run projects on gitee. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn