通过git同步本地笔记到github

同步笔记到github

  1. 在github上建立私有仓库md
  2. 创建本地仓库,用git-cmd.exe打开

image-20210313204814697

  1. 默认上传所有若要去除一些参见https://blog.csdn.net/weixin_44539199/article/details/106608302

  2. 关联仓库

    image-20210313205359423

git remote add origin git@github.com:[huiguo07]/[md].git

git remote -v
  1. 本地文件同步到远程

    • 在目录的命令行工具中依此执行

    git add .
    git commit -m “some description”
    git push -u origin master

    
    - 
    
    ![image-20210313210554643](https://img-blog.csdnimg.cn/img_convert/a135914c72d7046e62cd6bb3f655aa79.png)
    
    

出现错误

image-20210313211940540

生成ssh keyhttps://www.jianshu.com/p/259773014e03

ssh-keygen -t rsa -C “your_email@example.com”

image-20210313212129084

image-20210313212219159

image-20210314112351931

将md密钥添加到github上

image-20210314112438810

以下亲测有用上面的没有尝试成功

  1. 打开git.bash
git config --global user.eamil "1365769243@qq.com"

git config --global user.name "guohui"

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GOdL6eZn-1619266818972)(C:%5CUsers%5CAdministrator%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20210314180021240.png)]

  1. 切换到上传的目录

    image-20210314180149209

  2. 在上传的目录下初始化

    image-20210314180305675

  3. image-20210314180342696

  4. image-20210314180642363

image-20210314180724324

image-20210314181117919

image-20210314181236115

image-20210314181619531

git add .
git commit -m "some description"
git remote add origin https://github.com/huiguo07/md.git //建立远程连接
git push -u origin master
git config --system http.sslverify false  //关闭证书校验。
git config --global --unset http.proxy    //不使用代理

git push -u origin master

覆盖掉之前的,重新上传

image-20210323212054145

image-20210323212120796

cd D:/md
git add .
git commit -m "some description"
git remote add origin https://github.com/huiguo07/md.git //建立远程连接
git remote set-url origin https://github.com/huiguo07/md.git   //清除链接
git push -u origin master


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值