git提交总结

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值