Products
GG网络技术分享 2025-10-27 18:26 2
登录GitLab网站,选择新鲜建项目的组织或个人账户,点击“New Project”按钮创建新鲜项目。

在项目根目录下创建一个README文件和一个.gitignore文件。
$ touch README.md
$ touch .gitignore
在命令行窗口中进入要存放项目代码的目录,初始化Git仓库。
$ git init
$ git add .
输入git commit命令提交你的更改,并添加一条说说性的提交信息。
$ git commit -m "Initial commit"
$ git push origin master
在GitLab网站页面中打开项目,点击“+”号,选择“New Branch”。
$ git add README.md
$ git add .
输入新鲜分支名称并点击“Create branch”按钮。
$ git init
$ git remote add origin :username/repo-name.git
$ git add .
$ git commit -m "Initial commit"
$ git push -u origin master
$ git checkout -b new-branch
$ git branch new-branch
$ git checkout new-branch
在本地创建一个文件夹,用来存放项目代码。
$ git add ./
将文件添加到Git暂存区,并提交代码到远程Git仓库。
$ git commit -m "Some changes on new-branch"
$ git push origin new-branch
通过以上步骤,您已经成功创建了一个Git项目并完成了全部少许不了步骤。眼下您能开头用Git进行版本控制和项目管理了。
欢迎用实际体验验证观点。
Demand feedback