企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
GitLab是一个利用 Ruby on Rails(Ruby on Rails, or Rails, is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller framework, providing default structures for a database, a web service, and web pages)开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。GitLab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。 1)基础环境准备 ~~~ #安装技术依赖 ~~~ ~~~ yum install curl policycoreutils openssh-server openssh-clients postfix ~~~ #启动ssh服务&设置为开机启动 ~~~ #启动postfix并设置为开机启动 ~~~ ~~~ systemctl start postfix systemctl enable postfix systemctl enable sshd systemctl start sshd ~~~ 添加GitLab社区版Package ~~~ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash ~~~ 接下来跟github一样。 ##### Git global setup ~~~ git config --global user.name "J GQ" git config --global user.email "mrjiangguoqing@gmail.com" ~~~ ##### Create a new repository ~~~ git clone https://gitlab.com/j.gq/ok.git cd ok touch README.md git add README.md git commit -m "add README" git push -u origin master ~~~ ##### Push an existing folder ~~~ cd existing_folder git init git remote add origin https://gitlab.com/j.gq/ok.git git add . git commit -m "Initial commit" git push -u origin master ~~~ ##### Push an existing Git repository ~~~ cd existing_repo git remote rename origin old-origin git remote add origin https://gitlab.com/j.gq/ok.git git push -u origin --all git push -u origin --tags ~~~