1.clone你需要的项目
git clone xxx
2.进入项目目录
cd xxx
3.删除原有的git信息,有问题一直回车
rm -rf .git
4.初始化git
git init
5.将本地代码添加到仓库
git add .
git commit -m "初始化仓库文件"
(如果 git add . 报错 The file will have its original line endings in your working directory,执行命令: git config --global core.autocrlf false 代表禁用换行)
6.在gitee 官网上新建一个项目,注意不要生成README文件,生成一个 分支模型master
7.关联远程库
git remote add origin 远程库地址(例如:https://gitee.com/XXX/xxx.git)
8.提交代码
git push --set-upstream origin master