gitlab 第1次提交代码到1个新仓库

1.如果是本地刚刚搭建好git环境,第一次和gitlab服务器产生连接

参照这个文

https://www.cnblogs.com/kaerxifa/p/10929098.html

2.已经和gitlab产生连接(提交代码到过仓库A,现在要第一次提交代码到仓库B)

和上文大同小异

step1:

1.先在gitlab创建一个仓库,将项目clone至本地(为了得到.git文件,和远程的gitlab仓库产生连接)

root@wangju-HP-348-G4:/home/wangju/PycharmProjects# git clone http://git.xxxx.com/kaifa/reponselogiccheck.git
正克隆到 'reponselogiccheck'...
remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 33 (delta 3), reused 31 (delta 3)
展开对象中: 100% (33/33), 完成.

2.将已经写好的项目目录(不要项目名,只要项目文件)复制到clone好的文件夹中

3.

git add .

 

git commit -m "first commit"

 

 

git push -u origin master

 

well done 项目代码就提交到仓库了

 

Git global setup
git config --global user.name "集成账号"
git config --global user.email "ciadmin@5i5j.com"

Create a new repository
git clone git@gitlab.it.5i5j.com:qa/case-test.git
cd case-test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Push an existing folder
cd existing_folder
git init
git remote add origin git@gitlab.it.5i5j.com:qa/case-test.git
git add .
git commit -m "Initial commit"
git push -u origin master

Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.it.5i5j.com:qa/case-test.git
git push -u origin --all
git push -u origin --tags

 

posted @ 2019-06-17 14:36  wangju003  阅读(4103)  评论(0编辑  收藏  举报