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)