将本地项目上传到gitlab 您所在的位置:网站首页 idea上传本地项目到gitlab 将本地项目上传到gitlab

将本地项目上传到gitlab

2023-12-19 03:19| 来源: 网络整理| 查看: 265

1、安装git    https://git-scm.com/downloads

 

2、新建工程

a、步骤一

b、步骤二

 

 

3、创建密钥

   a、桌面右键

 

 b、cd ~/.ssh/

如果提示 “ No such file or directory”,你可以手动的创建一个 .ssh文件夹即可

 mkdir ~/.ssh

c、配置全局的name和email,参照你创建的工程Git global setup

git config --global user.name "zhouchengle"

git config --global user.email "[email protected]"

 

  d、生成key

      ssh-keygen -t rsa -C "[email protected]"

 e、最后生成两个文件:id_rsa和id_rsa.pub 

 f、把id_rsa.pub里的内容粘贴到gitlab密钥中

g、密钥创建成功

4、上传项目

a、右键要上传的项目,选择Git Bash Here

b、输入下面的命令()

git config --global user.name "zhouchengle"

git config --global user.email "[email protected]"

git init

git remote add origin [email protected]:Visual-analysis/mytest.git

 

(remote origin already exists 错误解决办法

git remote rm origin)

 

添加

 

git add .

 

(add操作 warning:The file will have its original line endings in your working directory

    Git 命令行输入如下命令,禁止自动转换换行符  git config --global core.autocrlf false

 

 

 

git commit -m "test"

git push -u origin master

参考创建的工程页面:

c、项目上传成功

 

git config --global core.autocrlf false



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有