以下所有操作都在命令行进行

1 git 配置

git config --global user.name “用户名”

git config --global user.email “邮箱”
2 生成公钥私钥

    #ssh-keygen -t rsa -C "xxxxx@xxxxx.com"

一路Enter下去,将生成的公钥填在码云上

    #cat ~/.ssh/id_rsa.pub

3建立git仓库

在你的项目文件夹下执行git命令

git init

4 将项目文件添加到仓库中

git add .

5 将add的文件commit到仓库

git commit -m '备注'

6 将本地仓库关联到码云上

git remote add origin git@gitee.com:shiqingqing/test.git

7 上传码云前要先pull 下

git pull origin  master

8  最后一步 上传代码到码云仓库

git push -u origin master //如果这一句报错,则执行 git pull --rebase origin master 后再执行该句,会下载README.md文件到本地,则可正常上传。

执行完后到码云看你项目的代码

相关文章:

  • 2021-11-28
  • 2021-08-10
  • 2021-10-23
猜你喜欢
  • 2021-12-11
  • 2021-09-29
  • 2022-12-23
相关资源
相似解决方案