1、解决git clone报错Peer’s Certificate has expired的问题
以往在学习一些github上的开源项目时,都是直接复制了项目的地址,然后在主机上git clone一下即可,然而最近发现总是报错,报错内容如下:
[root@localhost mnt]$git clone https://github.com/Meituan-Dianping/SQLAdvisor.git
Cloning into 'SQLAdvisor'...
fatal: unable to access 'https://github.com/Meituan-Dianping/SQLAdvisor.git/': Peer's Certificate has expired.
解决办法有两种。
其一:可以在github处通过下载zip包的方式进行下载。
其二:将刚刚连接中的https改为git即可正常下载。
[root@localhost mnt]$git clone git://github.com/Meituan-Dianping/SQLAdvisor.git
Cloning into 'SQLAdvisor'...
remote: Counting objects: 1460, done.
remote: Total 1460 (delta 0), reused 0 (delta 0), pack-reused 1460
Receiving objects: 100% (1460/1460), 19.92 MiB | 48.00 KiB/s, done.
Resolving deltas: 100% (367/367), done.
2、git 遇到的问题以及对应的解决命令
提示:error:The following untracked working tree files would be overwritten by merge
执行命令:git clean -d -fx,作用是:删除没有git add 的文件
3、git解决代码冲突
发生代码冲突
1 如果希望保存本地改动并拉下最新服务器代码,手动merge
(1)要保留服务器上的修改
1>git stash
git stash list将当前的Git栈信息打印出来
1>git stash list
stash@{0}就是刚才保存的标记
(2)暂存了本地修改之后,pull内容
1>git pull
(3)还原暂存的内容
1>git stash pop stash@{0}
系统自动合并修改的内容,但是其中有冲突,需要解决其中的冲突
(4)解决文件中冲突的的部分
打开冲突的文件
Updated upstream 和=====之间的内容就是pull下来的内容
====和stashed changes之间的内容就是本地修改的内容
这种情况,git也不知道哪行内容是需要的,所以要自行确定需要的内容
直接编辑冲突了的文件(test.txt),把冲突标记删掉,把冲突解决正确
eg:
保留bb=2
保存退出
(5) 删除stash\
1>git stash drop stash@{0}
清除0编号的stash
清除所有stash
1>git stash clear
(6)提交aa/a.txt的修改
1>git add aa/a.txt
修改本地的其他文件,并提交到远程仓库
服务器上拉取代码
将本地的a.txt,bb=5,提交代码,更新到远程仓库
按照(1)-(6)步骤处理冲突
- 如果希望服务器上版本完全覆盖本地修改,使用如下命令回退并更新
1>git reset --hard
2>git pull
4、fatal: unable to access ‘https://github.com/luckman666/CheckScript.sh.git/’: TCP connection reset by peer
报错信息 :
解决办法 :
http、https更换成git
#git clone git://github.com/luckman666/CheckScript.sh.git
5、
6、
7、
参考链接 :
git 遇到的问题以及对应的解决命令 : https://www.jianshu.com/p/bc2eb5736486
解决git clone报错Peer’s Certificate has expired的问题 :
http://www.eryajf.net/1672.html
https://blog.csdn.net/qq_40199232/article/details/114993307