git上新建一个仓库
在本地克隆该仓库
把要上传的目录文件复制到里面
cd 进这个本地仓库目录
git init(克隆就不需要了)
git add .
git commit - m “”
git remote add origin + 远程仓库(克隆就无需执行这个命令了)
git push -u origin master
git pull 更新拉取
ps:一个巨坑 (打开隐藏的文件,.git文件所在目录就是git要上传的目录)
git bash重新登录命令: git config --system --unset credential.helper
git bash记住密码命令: git config --global credential.helper store
git 版本回退 : 方法1. git reset --hard HEAD ^ ( ^ 表示回到上一个版本,
如果需要回退到上上个版本的话,将HEAD改成HEAD^, 以此类推。
那如果要回退到前100个版本,这种方法肯定不方便,
我们可以使用简便命令操作:git reset --hard HEAD~100 );
方法2. git reset --hard 版本号 ,
获取到版本号命令: git reflog
git 上传图片:
在README.md加入命令: [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hVusOohF-1602144676166)(your image’s URL)]
上传图片不显示的解决方法:
在C:\Windows\System32\drivers\etc\hosts后面加入
192.30.253.119 gist.github.com
199.232.28.133 assets-cdn.github.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 gist.githubusercontent.com
199.232.28.133 camo.githubusercontent.com
199.232.28.133 cloud.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 avatars4.githubusercontent.com
199.232.28.133 avatars5.githubusercontent.com
199.232.28.133 avatars6.githubusercontent.com
199.232.28.133 avatars7.githubusercontent.com
199.232.28.133 avatars8.githubusercontent.com
复制域名(raw.githubusercontent.com)到www.ipaddress.com查询ip
复制域名( gist.github.com)到www.ipaddress.com查询ip