我有一个远程存储库,我们称之为subrepo。我想将其作为子树包含在本地存储库中,我们将其称为mainrepo。我将把subrepo放在路径“subrepofold/”下。
我像往常一样添加了遥控器:
git remote add subrepo git@remote.subrepo.git
Run Code Online (Sandbox Code Playgroud)
在mainrepo上我只有一个分支(master)。我添加并承诺了所有:
git add --all
git commit -m "message"
git status
Run Code Online (Sandbox Code Playgroud)
在分支 master 上没有任何可提交的内容,工作目录干净
git diff-index HEAD --exit-code --quiet
Run Code Online (Sandbox Code Playgroud)
不给我输出。跑步:
git subtree pull --prefix="subrepofold" subrepo master --squash
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
工作树有修改。无法添加。
我知道这似乎正是此处描述的问题,但似乎没有一个回复能够解决该问题。
我有一个 .po 文件,如果 msgstr 为空,我需要将 msgid 值复制到 msgstr 值中。
例如
msgid "Hello"
msgstr ""
msgid "Dog"
msgstr "Cane"
Run Code Online (Sandbox Code Playgroud)
应该成为
msgid "Hello"
msgstr "Hello"
msgid "Dog"
msgstr "Cane"
Run Code Online (Sandbox Code Playgroud)
目前,出于测试目的,我正在处理另一个文件,但最终脚本将内联工作。
#!/bin/bash
rm it2.po
sed $'s/^msgid.*/&\\\n---&/' it.po > it2.po
sed -i '/^msgstr/d' it2.po
sed -i 's/^---msgid/msgstr/' it2.po
Run Code Online (Sandbox Code Playgroud)
这个脚本有两个问题(至少):
任何帮助,将不胜感激。提前致谢。
我有一个由 nginx 代理的 nextjs 项目。我正在使用由 nextjs 本身提供的休息 api,需要超过 2 分钟。
我得到的第一个错误是 nginx 504 超时,所以我添加了一些额外的指令:
proxy_connect_timeout 600s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
Run Code Online (Sandbox Code Playgroud)
然后错误代码变为 502。查看 proxy_error_log 文件,错误是
upstream prematurely closed connection while reading response header from upstream.
Run Code Online (Sandbox Code Playgroud)
在我的项目中,我没有明确使用express或任何其他服务器,所以我不知道如何设置http服务器超时。有什么方法可以从 next.config.js 文件或全局设置 Node js 的超时吗?