1、先进入源gitlab的git默认分支地址,如图:
2、在目标gitlab上建立同名称项目
3、下载源gitlab的git项目到本机,比如下载到桌面就在桌面git-bash,并执行下一句clone,这次clone的作用是拷贝到本机
##git clone http://192.168.3.11/things/test-example-static.git
4、在本机桌面建立一个临时文件夹1
5、
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (master)
$ git checkout -b develop
Switched to a new branch 'develop'
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git add .
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git commit -m "develop_init"
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git push origin develop
Counting objects: 186, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (169/169), done.
Writing objects: 100% (186/186), 4.52 MiB | 4.79 MiB/s, done.
Total 186 (delta 23), reused 0 (delta 0)
remote: Resolving deltas: 100% (23/23), done.
To http://192.168.3.239/xy/test-example-static.git
* [new branch] develop -> develop
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git branch -a
* develop
remotes/origin/develop
##新建一个分支,只有push和pull时才加origin指定
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git branch master
##最后
dell@DESKTOP-VD0M0KS MINGW64 ~/Desktop/1/test-example-static (develop)
$ git push origin develop
可以还原误删的代码