gitLad创建新仓库、上传项目、拉取项目方法

一、在gitLab上创建新项目

 

二、拉取、上传项目

创建项目完成后是一个空仓库,此时想要往仓库上上传一个项目,在本地选择一个文件夹右击。

 打开命令行后输入以下命令

 如果之前有别人的账户信息时一定要先清除本地账户信息

 git config --system --unset credential.helper

 git config --global credential.helper wincred

全局设置

git config --global user.name "名称"

git config --global user.email "邮箱地址"

创建新版本库

git clone http://****/ceshigit.git

cd ceshigit

touch README.md

git add README.md

git commit -m "add README"

git push -u origin master

然后把需要上传的文件放到ceshigit文件夹中,进入ceshigit文件夹输入命令

git add  . 

git commit  -m  '信息'

git push -u origin master

到这一步已经第一次项目上传成功了。

如果已经有项目时,输入以下命令可上传

cd existing_folder

git init

git remote add origin http:/*****/ceshigit.git

git add .

git commit -m '信息'

git pull

git push -u origin master

如果push时报错没有权限上传,可以在gitLab上面中将你设置成主程序员,并在保护分支中取消master保护。

  

 
 

原文地址:https://www.cnblogs.com/xibaomeng/p/14975844.html