alan3258 发表于 2021-6-29 08:23

【笔记】GitLab初始化仓库脚本记录

gitlab创建新项目后,可以通过以下方式导入或新建项目到版本控制中。

Git global setup
git config --global user.name "username"
git config --global user.email "username@163.com"

Create a new repository
git clone ssh://git@git.git.com/username/project.git
cd project
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 ssh://git@git.git.com/username/project.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 ssh://git@git.git.com/username/project.git
git push -u origin --all
git push -u origin --tags
页: [1]
查看完整版本: 【笔记】GitLab初始化仓库脚本记录