码迷,mamicode.com
首页 > 其他好文 > 详细

gitlab操作

时间:2021-01-22 11:59:10      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:recorder   ini   current   nothing   message   cts   compress   ssi   done   

新建一个gitlab,用于提交代码,然后git bash。

 

A20331@A200331R MINGW64 /d/workspace/gitlab (master)
$ git clone git@10.240.1.140:tools-dev-team/ecusimulatorrecorder.git    ---> http://10.240.1.140/tools-dev-team/ecusimulatorrecorder  页面上的Clone按钮
Cloning into ‘ecusimulatorrecorder‘...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.

 

A20331@A200331R MINGW64 /d/workspace/gitlab (master)
$ cd ecusimulatorrecorder/  ---> 进入clone下来的项目

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (master)
$ git checkout -b dev   --->新建一个branch名称,叫dev
Switched to a new branch ‘dev‘

===把需要提交的代码复制放到 ecusimulatorrecorder文件夹下

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git status ---》查看文件夹下的文件信息
On branch dev
Untracked files:
(use "git add <file>..." to include in what will be committed)
EcuSimulatorRecord.py
"EcuSimulatorRecord\345\275\225\345\210\266\345\267\245\345\205\267\344\275\277\347\224\250\346\211\213\345\206\214.docx"
config.ini
requirements.txt
versionfile.txt

nothing added to commit but untracked files present (use "git add" to track)

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git add . ---》点 . 表示添加所有的文件提交

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git status ---》提交文件变绿,表示可以提交
On branch dev
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: EcuSimulatorRecord.py
new file: "EcuSimulatorRecord\345\275\225\345\210\266\345\267\245\345\205\267\344\275\277\347\224\250\346\211\213\345\206\214.docx"
new file: config.ini
new file: requirements.txt
new file: versionfile.txt


A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git commit -m "SUBMIT CODE"   --》提交文件, -m为message 名称为“”里的内容
[dev 6ef0c03] SUBMIT CODE
5 files changed, 1239 insertions(+)
create mode 100644 EcuSimulatorRecord.py
create mode 100644 "EcuSimulatorRecord\345\275\225\345\210\266\345\267\245\345\205\267\344\275\277\347\224\250\346\211\213\345\206\214.docx"
create mode 100644 config.ini
create mode 100644 requirements.txt
create mode 100644 versionfile.txt

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git status  ---》检查提交情况,显示没有提交信息,显示没有upstream,要用 git push --set-upstream origin dev 提交
On branch dev
nothing to commit, working tree clean

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git push
fatal: The current branch dev has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin dev --》用这个命令重新提交


A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git push --set-upstream origin dev
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 98.86 KiB | 9.88 MiB/s, done.
Total 7 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for dev, visit:
remote: http://10.240.1.140/tools-dev-team/ecusimulatorrecorder/-/merge_requests/new?merge_request%5Bsource_branch%5D=dev
remote:
To 10.240.1.140:tools-dev-team/ecusimulatorrecorder.git
* [new branch] dev -> dev
Branch ‘dev‘ set up to track remote branch ‘dev‘ from ‘origin‘.

A20331@A200331R MINGW64 /d/workspace/gitlab/ecusimulatorrecorder (dev)
$ git push --set-upstream origin dev ---》再次提交确认是否已提交完成
Everything up-to-date
Branch ‘dev‘ set up to track remote branch ‘dev‘ from ‘origin‘.

gitlab操作

标签:recorder   ini   current   nothing   message   cts   compress   ssi   done   

原文地址:https://www.cnblogs.com/banyanisdora/p/14308328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!