gitlab

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
You have access to an environment variable,
GITLAB_TOKEN
, which allows you to interact with the GitLab API.
<IMPORTANT> You can use `curl` with the `GITLAB_TOKEN` to interact with GitLab's API. ALWAYS use the GitLab API for operations instead of a web browser. ALWAYS use the `create_mr` tool to open a merge request </IMPORTANT>
If you encounter authentication issues when pushing to GitLab (such as password prompts or permission errors), the old token may have expired. In such case, update the remote URL to include the current token:
git remote set-url origin https://oauth2:${GITLAB_TOKEN}@gitlab.com/username/repo.git
Here are some instructions for pushing, but ONLY do this if the user asks you to:
  • NEVER push directly to the
    main
    or
    master
    branch
  • Git config (username and email) is pre-set. Do not modify.
  • You may already be on a branch starting with
    openhands-workspace
    . Create a new branch with a better name before pushing.
  • Use the
    create_mr
    tool to create a merge request, if you haven't already
  • Once you've created your own branch or a merge request, continue to update it. Do NOT create a new one unless you are explicitly asked to. Update the PR title and description as necessary, but don't change the branch name.
  • Use the main branch as the base branch, unless the user requests otherwise
  • After opening or updating a merge request, send the user a short message with a link to the merge request.
  • Do all of the above in as few steps as possible. E.g. you could push changes with one step by running the following bash commands:
bash
git remote -v && git branch # to find the current org, repo and branch
git checkout -b create-widget && git add . && git commit -m "Create widget" && git push -u origin create-widget
你可以访问环境变量
GITLAB_TOKEN
,它允许你与GitLab API进行交互。
<IMPORTANT> 你可以使用`curl`搭配`GITLAB_TOKEN`来与GitLab的API交互。 请始终使用GitLab API执行操作,而非网页浏览器。 请始终使用`create_mr`工具来创建合并请求 </IMPORTANT>
当你向GitLab推送代码时遇到认证问题(如密码提示或权限错误),可能是旧令牌已过期。这种情况下,请更新远程URL以包含当前令牌:
git remote set-url origin https://oauth2:${GITLAB_TOKEN}@gitlab.com/username/repo.git
以下是一些推送操作的说明,但仅在用户要求时执行:
  • 切勿直接推送到
    main
    master
    分支
  • Git配置(用户名和邮箱)已预先设置,请勿修改。
  • 你当前可能处于以
    openhands-workspace
    开头的分支。在推送前请创建一个命名更合理的新分支。
  • 如果你还没有创建合并请求,请使用
    create_mr
    工具创建。
  • 一旦你创建了自己的分支或合并请求,请持续更新它。除非明确要求,否则不要创建新的分支或合并请求。必要时更新合并请求的标题和描述,但不要修改分支名称。
  • 除非用户另有要求,否则请以主分支作为基准分支。
  • 打开或更新合并请求后,向用户发送一条包含合并请求链接的简短消息。
  • 请用最少的步骤完成上述所有操作。例如,你可以通过运行以下bash命令一步推送更改:
bash
git remote -v && git branch # to find the current org, repo and branch
git checkout -b create-widget && git add . && git commit -m "Create widget" && git push -u origin create-widget