git 分支创建并上传 用bash工具

1.创建branch,新创建的分支名称education

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git branch
* master

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git branch -a
* master
  remotes/origin/master

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ cd ..
l
jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git
$ ls
A1S2D3F4G5H6J7K8L9  A1S2D3F4G5H6J7K8L9.pub  NewVehicle/  README.md

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git
$ git branch
fatal: not a git repository (or any of the parent directories): .git

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git
$ cd NewVehicle/

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ ls
pduVehicle/

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git branch
* master

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git branch education

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git branch
  education
* master

2.把分支上传到gitlab,然后切换到创建的的education分支上

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git push origin education
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 8 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 608.82 KiB | 3.93 MiB/s, done.
Total 8 (delta 6), reused 0 (delta 0), pack-reused 0
To http://gitlab.neolix.cn/space/new_vehicle.git
 * [new branch]      education -> education

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (master)
$ git checkout education
Switched to branch 'education'

3.把education工程上传到gitlab

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (education)
$ git add .
warning: LF will be replaced by CRLF in pduVehicle/Makefile.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in pduVehicle/README.en.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in pduVehicle/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in pduVehicle/begin.sh.
The file will have its original line endings in your working directory
jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (education)
$ git commit -m "教育小车education_0.8.2"
[education 2a2fe29] 教育小车education_0.8.2
 3 files changed, 11 insertions(+), 7 deletions(-)

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (education)
$ git push
fatal: The current branch education has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin education


jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (education)
$ git push --set-upstream origin education
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 8 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 357.69 KiB | 2.65 MiB/s, done.
Total 8 (delta 6), reused 0 (delta 0), pack-reused 0
To http://gitlab.neolix.cn/space/new_vehicle.git
   50e67d5..2a2fe29  education -> education
Branch 'education' set up to track remote branch 'education' from 'origin'.

jiang@DESKTOP-H9PNI47 MINGW64 /d/File/Git/NewVehicle (education)

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值