Gitcode实现从本地添加项目到远程仓库的问题总结

Q1:基本流程

 A:

  1. 进入目标目录(本地仓库地址)
    cd d:/目标目录地址

  2. 初始化
    git init hello.cpp
    
  3. 添加文件
    git add hello.cpp
  4. 提交版本
    git commit -m "test"
  • 上传远程代码并合并
    $ git push -u origin master -f

Q2:关联远程仓库的方式

A:

  1. #SSH#
    $ git remote add origin [email protected]/qq_52281545/221900230.git
    创建ssh key:原文链接
    $ ssh-keygen -t rsa -C "[email protected]"

         登录:

$ ssh -T [email protected]
  1. #Https#
    git remote add orgin https://gitcode.net/qq.52281545/221900230
    !!!:“上传远程代码并合并”的步骤中会出现一个弹窗。。。没找着怎么解决,就先pass了

Q3:fatal:‘origin‘ does not appear to be a git repository fatal:Could not read from remote repository

A: Q3解决方案链接

Q4:git push后报错:! [remote rejected] master -> master (pre-receive hook declined)

A:Q4解决方法原链接

猜你喜欢

转载自blog.csdn.net/qq_52281545/article/details/122877413