本文将为您提供关于通过html小部件将文件上传到github存储库?的详细介绍,我们还将为您解释html文件上传到网站的相关知识,同时,我们还将为您提供关于AnsibleGalaxy集合依赖SSH错误
本文将为您提供关于通过 html 小部件将文件上传到 github 存储库?的详细介绍,我们还将为您解释html文件上传到网站的相关知识,同时,我们还将为您提供关于Ansible Galaxy 集合依赖 SSH 错误与私有 GitHub 存储库、GitHub Actions 的默认“签出 Git 存储库”作业:它有什么作用?、Github:远程似乎不是 git 存储库、npm 通过 package.json 中的依赖项安装私有 github 存储库的实用信息。
本文目录一览:- 通过 html 小部件将文件上传到 github 存储库?(html文件上传到网站)
- Ansible Galaxy 集合依赖 SSH 错误与私有 GitHub 存储库
- GitHub Actions 的默认“签出 Git 存储库”作业:它有什么作用?
- Github:远程似乎不是 git 存储库
- npm 通过 package.json 中的依赖项安装私有 github 存储库
通过 html 小部件将文件上传到 github 存储库?(html文件上传到网站)
如何解决通过 html 小部件将文件上传到 github 存储库?
有没有办法制作一个 html 小部件,让我网站上的用户可以将文件上传到我的 github 存储库?
解决方法
用户将文件上传到您的服务器,然后您的服务器将该文件放入 github 存储库,然后提交并推送它 :D
Ansible Galaxy 集合依赖 SSH 错误与私有 GitHub 存储库
如何解决Ansible Galaxy 集合依赖 SSH 错误与私有 GitHub 存储库
作为 Ansible 集合的新手,我希望我在尝试将一些旧的 Ansible 角色重构为使用私有 GitHub 存储库的集合时错过了一些明显的东西。
我在 GitHub 上设置了 2 个关联帐户。我将调用主个人帐户 GITHUB_AC_P
。个人帐户与我称为 GITHUB_AC_O
的子组织帐户相关联。我可以在 GitHub Web UI 中的这些帐户之间切换,并使用 ~/.ssh/config
中的以下单个条目通过 git 客户端访问两个帐户:
Host GITHUB_AC_P.github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github_REDACTED_GITHUB_A
我首先将 Ansible galaxy 集合文件添加到帐户 ansible.common
中名为 GITHUB_AC_O
的新 GitHub 存储库。我计划在其他 Ansible galaxy 集合中重复使用这个集合。它目前只有一个角色和以下 galaxy.yml
文件:
namespace: REDACTED_NS
name: common
version: 0.0.1
description: "Common Ansible collection"
readme: README.md
authors:
- REDACTED_AUTHOR
以下命令报告“安装成功”,我在 ~/.ansible/collections/ansible_collections/REDACTED_NS/common
中看到了集合:
ansible-galaxy collection install git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git,main
然后,我在名为 ansible.harden_host
的新 GitHub 存储库中创建了第二个 Ansible galaxy 集合。这也在帐户 GITHUB_AC_O
中。这当前没有角色,并使用以下 galaxy.yml
文件来引用上述公共集合(REDACTED_NS 的值在两个galaxy.yml 文件中相同):
namespace: REDACTED_NS
name: harden_host
version: 0.0.1
description: "Ansible collection to harden hosts"
readme: README.md
authors:
- REDACTED_AUTHOR
dependencies: {
REDACTED_NS.common: git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git,main
}
但是当我运行以下命令时:
ansible-galaxy collection install --verbose git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.harden_host.git,main
失败并显示消息:
Starting galaxy collection install process
Process install dependency map
ERROR! UnkNown error when attempting to call galaxy at ''https://galaxy.ansible.com/api/'': <urlopen error [SSL: CERTIFICATE_VERIFY_Failed] certificate verify Failed: unable to get local issuer certificate (_ssl.c:1123)>
为什么要点击 galaxy.ansible.com
而不是我的 GitHub 帐户?
当我添加 --ignore-certs
并运行以下命令时:
ansible-galaxy collection install --ignore-certs git@GUTHUB_AC_P.github.com:GITHUB_AC_O/ansible.harden_host.git,main
它失败并显示不同的消息:
ERROR! Failed to find collection REDACTED_NS.common:git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git
我将此错误中的 URI(冒号右侧)粘贴到 ansible-galaxy collection install
命令中,以验证 URI 中没有拼写错误。这工作得很好。
字符串 REDACTED_NS 不等于 GITHUB_AC_P 或 GITHUB_AC_O 的值。
如果有人可以解释这里有什么问题以及如何解决问题,我们将不胜感激。
解决方法
解决了;似乎答案隐藏在 Ansible 的 Using collections 文档中的普通站点中,该文档说对基于 git 的依赖项使用以下表单:
dependencies: {''git@github.com:organization/repo_name.git'': ''devel''}
我使用的表单是针对 Galaxy 服务器的,因此它点击了 galaxy.ansible.com
(除非我用 --server localhost
覆盖了默认值)。
所以下面的形式有效(git repo 后跟 git 引用):
namespace: REDACTED_NS
name: harden_host
version: 0.0.1
description: "Ansible collection to harden hosts"
readme: README.md
authors:
- REDACTED_AUTHOR
dependencies: {
''git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git'': ''main''
}
GitHub Actions 的默认“签出 Git 存储库”作业:它有什么作用?
如何解决GitHub Actions 的默认“签出 Git 存储库”作业:它有什么作用?
默认情况下,我的 GitHub 操作都添加了相同的倒数第二个步骤:
const arr = [
{
"Student Name": "ashy","Term1": 200,"Term2": 300,"Total": 500
}
]
这些 Post Check out Git repository
---
Post job cleanup.
$> /usr/bin/git version
git version 2.32.0
$> /usr/bin/git config --local --name-only --get-regexp core\\.sshCommand
$> /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp ''core\\.sshCommand'' && git config --local --unset-all ''core.sshCommand'' || :
$> /usr/bin/git config --local --name-only --get-regexp http\\.https\\:\\/\\/github\\.com\\/\\.extraheader
http.https://github.com/.extraheader
$> /usr/bin/git config --local --unset-all http.https://github.com/.extraheader
$> /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp ''http\\.https\\:\\/\\/github\\.com\\/\\.extraheader'' && git config --local --unset-all ''http.https://github.com/.extraheader'' || :
命令的作用是什么?为什么它们会在 GitHub 操作工作流完成后运行?由于 GitHub Action 在容器或 VM 中执行,我认为它最终可以简单地“镇压”而无需显式清理。
我只是想知道每次我的 GitHub Action 执行时运行的这段代码背后的内容和原因。
Github:远程似乎不是 git 存储库
如何解决Github:远程似乎不是 git 存储库
我在 Github 抛出错误时遇到了一些问题:fatal: ''remote'' 似乎不是 git 存储库。
我进行了克隆,成功了。
a
然后我做了这个,结果出现了错误信息
git clone https://github.com/StephenW789/CIS-41B-Final-Project-Public
cd CIS-41B-Final-Project-Public
git remote -v # Prints out the correct origin as expected
我尝试了以下方法,但问题仍然存在。
git fetch remote main
fatal: ''remote'' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
谢谢。
解决方法
这是因为 remote
不是遥控器的名称:origin
是遥控器的名称。那就是:你想要git fetch remote
而不是git fetch origin
。
我和 Lasse V. Karlsen 和你自己一样,在最初的几次通读中错过了这一点。很容易将“remote”读作遥控器的正确名称。 :-)
npm 通过 package.json 中的依赖项安装私有 github 存储库
我正在尝试通过 npm 安装 github 私有存储库,其中包括其他私有 github 存储库作为依赖项。
尝试了很多方法和帖子,但没有一个有效。这是我正在做的事情:
npm install git+https://github.com/myusername/mygitrepository.git
在 package.json 中是这样的:
"dependencies": { "repository1name": "git+https://github.com/myusername/repository1.git", "repository2name": "git+https://github.com/myusername/repository2.git"}
正确的方法是什么?
答案1
小编典典以下在我需要的所有情况下都可以正常工作:
"dependencies": {"GitRepo": "git+https://<token-from-github>:x-oauth-basic@github.com/<user>/<GitRepo>.git"}
关于通过 html 小部件将文件上传到 github 存储库?和html文件上传到网站的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Ansible Galaxy 集合依赖 SSH 错误与私有 GitHub 存储库、GitHub Actions 的默认“签出 Git 存储库”作业:它有什么作用?、Github:远程似乎不是 git 存储库、npm 通过 package.json 中的依赖项安装私有 github 存储库等相关内容,可以在本站寻找。
本文标签: