自摘: 林德熙博客 http://blog.csdn.net/lindexi_gd

在合并pull两个不同的项目,会出现的问题: refusing to merge unrelated histories

先pull,因为两个仓库不同,发现refusing to merge unrelated histories

无法pull

因为他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码,在git pull,这句代码是在git 2.9.2版本发生的,最新的版本需要添加--allow-unrelated-histories

假如我们的源是origin,分支是master,那么我们 需要这样写

git pull origin master --allow-unrelated-histories

需要知道,我们的源可以是本地的路径

咱们做开发的,被墙掉了真的很郁闷,有时候想看个资料,下载个开发工具啥的,真的很苦闷无语

自己搞个代理服务器吧

需要共享的小伙伴可以留言哈

不错大家拿去别做违法犯忌的事,另外不要从事较大的流量传输活动哦,本人小小码农有点负担不起哦。

我们可以通过git version确定当前的git版本(如果小于2.0,更新是个更好的选择),通过
git config --global push.default [option]
改变push.default的默认行为(或者也可直接编辑~/.gitconfig文件)。

push.default 有以下几个可选值:
nothing, current, upstream, simple, matching

其用途分别为:

nothing - push操作无效,除非显式指定远程分支,例如git push origin develop(我觉得。。。可以给那些不愿学git的同事配上此项)。

current - push当前分支到远程同名分支,如果远程同名分支不存在则自动创建同名分支。

upstream - push当前分支到它的upstream分支上(这一项其实用于经常从本地分支push/pull到同一远程仓库的情景,这种模式叫做central workflow)。

simple - simple和upstream是相似的,只有一点不同,simple必须保证本地分支和它的远程 upstream分支同名,否则会拒绝push操作。

matching - push所有本地和远程两端都存在的同名分支

git pull
弄清楚git push的默认行为后,再来看看git pull。

当我们未指定当前分支的upstream时,通常git pull操作会得到如下的提示:

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> new1

git pull的默认行为和git push完全不同。
当我们执行git pull的时候,实际上是做了git fetch + git merge操作,fetch操作将会更新本地仓库的remote tracking,也就是refs/remotes中的代码,并不会对refs/heads中本地当前的代码造成影响。

当我们进行pull的第二个行为merge时,对git来说,如果我们没有设定当前分支的upstream,它并不知道我们要合并哪个分支到当前分支,所以我们需要通过下面的代码指定当前分支的upstream:

git branch --set-upstream-to=origin/ develop
// 或者git push --set-upstream origin develop
实际上,如果我们没有指定upstream,git在merge时会访问git config中当前分支(develop)merge的默认配置,我们可以通过配置下面的内容指定某个分支的默认merge操作

[branch "develop"]
remote = origin
merge = refs/heads/develop // [1]为什么不是refs/remotes/develop?

或者通过command-line直接设置:

git config branch.develop.merge refs/heads/develop
这样当我们在develop分支git pull时,如果没有指定upstream分支,git将根据我们的config文件去merge origin/develop;如果指定了upstream分支,则会忽略config中的merge默认配置。

以上就是git push和git pull操作的全部默认行为,如有错误,欢迎斧正

自动验证域名
这个命令摘自proxySU的客户端自动申请更换证书,把域名解析到主机IP上,使用caddy会自动启动一个http服务为域名做域名验证,省去了自动配置网站的步骤,注意如果80端口被占用就要先停掉,适合没有web服务的服务器使用

acme.sh --force --debug --issue  --standalone  -d proxy2.xxx.com  --pre-hook "systemctl stop caddy"  --post-hook  "systemctl start caddy" --server letsencrypt

1. 安装 acme.sh
安装很简单, 一个命令:

curl https://get.acme.sh | sh -s email=my@example.com

普通用户和 root 用户都可以安装使用. 安装过程进行了以下几步:

把 acme.sh 安装到你的 home 目录下:

~/.acme.sh/

并创建 一个 shell 的 alias, 例如 .bashrc,方便你的使用: alias acme.sh=~/.acme.sh/acme.sh

自动为你创建 cronjob, 每天 0:00 点自动检测所有的证书, 如果快过期了, 需要更新, 则会自动更新证书.
更高级的安装选项请参考: https://github.com/Neilpang/acme.sh/wiki/How-to-install

安装过程不会污染已有的系统任何功能和文件, 所有的修改都限制在安装目录中: ~/.acme.sh/

中国大陆用户请参考:

https://github.com/acmesh-official/acme.sh/wiki/Install-in-China

以上链接说明内容如下:
如果你的安装服务器位于中国大陆境内, 访问 github 可能会不成功. 所以安装可能会失败.

推荐从这里下载安装:

#centos7.9系统,实操时报错:No such file or directory
https://gitee.com/neilpang/acme.sh

#从原仓库复制了一个20240120
https://e.coding.net/youxianbo/tools/acme.sh.git

安装步骤:
根据 How-to-install#3-or-git-clone-and-install

git clone https://gitee.com/neilpang/acme.sh.git
cd acme.sh
./acme.sh --install -m my@example.com
# 网站服务器上申请
#nginx配置
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        default_type text/html;
        allow all;
    }
#申请命令
acme.sh --issue --webroot /home/wwwroot/xxx -d www.xxx.com,m.xxx.com

# 手动DNS申请
acme.sh --issue -d www.xxx.com,m.xxx.com --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please
#会报错,提示需要解析
#手动解析后再尝试执行命令,加上 --renew  参数
acme.sh --renew -d www.xxx.com,m.xxx.com --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please
#如果同时申请多个域名,--renew出现以下报错的话,可能需要改成单个域名才能找到申请的目录
#报错:
'm.xx.com,www.xx.com' is not an issued domain, skipping.
#换成单个域名(第一个域名,因为申请的时候key放到这个目录了m.xx.com_ecc/m.xx.com.key,renew的时候去m.xx.com,www.xx.com这个目录找,找不到文件)
acme.sh --renew -d m.xx.com --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please

检测网站证书

https://www.ssllabs.com/ssltest/index.html
https://myssl.com/dns_check.html#ssl_verify

./configure -prefix=/usr/local/php7 -with-config-file-path=/usr/local/php7/etc -with-mcrypt=/usr/include -enable-mysqlnd -with-gd -with-iconv -with-zlib -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -enable-mbregex -enable-fpm -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -with-gettext -with-curl -with-jpeg-dir -with-freetype-dir -with-mysqli -enable-embedded-mysqli -with-pdo-mysql