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-****** -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