如何通过github上传项目并在readme.md中展示图片二维码

时间:2023-03-08 22:47:25
将本地项目上传至github
第一步:git init (创建仓库)
第二步:git add README.md (添加项目)git add *
第三步:git commit -m "first commit" (添加备注)
第四步:git remote add origin https://github.com/chenchu001/xijuyuanh5.git (连接到服务器地址)
可能出现问题 fatal: remote origin already exists.  
解决方案:
1、先输入$ git remote rm origin
2、再输入git remote add origin https://github.com/chenchu001/xijuyuanh5.git 就不会报错了!
第五步:git push -u origin master(上传)
在readme.md中展示图片二维码

1、首先把图片放到程序里。提交到Github远程仓库。

2、在浏览器进入远程Github仓库找到图片打开图片。那么当前浏览器链接就是图片地址。复制出来。

3、打开README.md 进入编辑状态。放入如下代码进入编辑框。保存即可看见效果

![image](https://github.com/chenchu001/shopcart/blob/master/static/images/shopcart.png)

其中  https://github.com/chenchu001/shopcart/blob/master/static/images/shopcart.png  是我的图片地址。你们替换成你想显示的图片地址即可