[英]What Happens When Import Git Repos to GitLab
I am wondering if someone could please help me understand what exactly happens when we import Git Repos to Gitlab.我想知道是否有人可以帮助我了解当我们将 Git Repos 导入 Gitlab 时到底发生了什么。 Does metadata change?元数据会改变吗? Are some database entries made on Gitlab side.是否在 Gitlab 端创建了一些数据库条目。 The reason I am asking this is why we cannot use gitlab without importing git repos to gitlab first.我问这个的原因是为什么我们不能在不先将 git repos 导入 gitlab 的情况下使用 gitlab。 Is there a way to make gitlab work with git repos out of the box without importing them.有没有办法让 gitlab 开箱即用地使用 git repos 而无需导入它们。
Furthermore, any helpful links that describe overall architecture of gitlab and how its different components interact or its workflow?此外,任何有用的链接描述了 gitlab 的整体架构以及它的不同组件如何交互或它的工作流程?
Any help would be highly appreciated.任何帮助将不胜感激。
Thanks.谢谢。
To host a repository on Gitlab, you must first create the repository in the web interface.要在 Gitlab 上托管存储库,您必须首先在 Web 界面中创建存储库。 The project page will give you a repo URL.项目页面将为您提供一个 repo URL。
If you want to add an existing git repo to gitlab:如果要将现有的 git repo 添加到 gitlab:
git remote add gitlab <gitlab repo URL>
git push gitlab master
If you're starting a repo from scratch, you can either clone it empty and add stuff to it like this:如果你从头开始一个 repo,你可以将它克隆为空并像这样添加东西:
git clone <gitlab repo URL>
cd repo_folder
# copy files there, create new ones,...
git add your_files
git commit -m "Added new files"
git push origin master
Or, initialize a git repository (in empty folder or folder that has existing code, both are OK), then add/commit:或者,初始化一个 git 存储库(在空文件夹或具有现有代码的文件夹中,两者都可以),然后添加/提交:
cd some_project_folder
git init
git remote add gitlab <gitlab repo URL>
git add .
git commit -m "Initial commit"
git push gitlab master
This is a very old question, and things may have changed since it was asked, but to answer them today (the latest GitLab release currently is 14.10, with 15.0 due on 22nd May 2022):这是一个非常古老的问题,自从被问到之后事情可能已经发生了变化,但今天要回答它们(当前最新的GitLab 版本是 14.10,15.0 将于 2022 年 5 月 22 日到期):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.