标签: github-cli

github git-credential:不支持“擦除”操作

我正在处理的 github 存储库遇到一些问题。我刚刚意识到我比 main 提前了 3 个提交,并且想要推送,但终端提示以下内容:

git push
gh auth git-credential: "erase" operation not supported
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/name/project/'
Run Code Online (Sandbox Code Playgroud)

有没有人遇到过这种情况并且可以提供帮助?

非常感谢

github-cli

13
推荐指数
2
解决办法
7579
查看次数

GPG 错误:https://cli.github.com/packages stable InRelease:EXPKEYSIG C99B11DEB97541F0

尝试使用 apt 包管理器更新 GitHub CLI 失败并出现以下错误:

Failed to fetch https://cli.github.com/packages/dists/stable/InRelease: The following signatures couldn't be verified because the public key is not available: EXPKEYSIG C99B11DEB97541F0
GPG error: The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0
Run Code Online (Sandbox Code Playgroud)

linux git repository github-cli

13
推荐指数
2
解决办法
1万
查看次数

如何使用新的 github cli 向远程存储库发出拉取请求,而无需推送远程分支?

我试图弄清楚如何从本地分支(甚至从本地主/主分支)向我的远程存储库创建 PR。但是,无论我做什么,我都会收到以下错误:

来自本地main的尝试:

(master)$ gh pr create --title "Adding readme" --body "Testing pr from cli" --head armsp:feature

Creating pull request for armsp:feature into master in armsp/----

pull request create failed: GraphQL error: Head sha can't be blank, Base sha can't be blank, No commits between master and feature, Head ref must be a branch
Run Code Online (Sandbox Code Playgroud)

当地feature分支机构的尝试:

(feature)$ gh pr create --title "Adding readme" --body "Testing pr from cli" --head armsp:feature

Creating pull request for armsp:feature into master …
Run Code Online (Sandbox Code Playgroud)

github github-cli

9
推荐指数
1
解决办法
1万
查看次数

如何使用 github-cli 创建 Git 存储库?

如何使用GitHub CLI创建 GitHub 存储库(而不是必须访问 github.com 并从其 GUI 创建 github 存储库)?

git github github-cli

8
推荐指数
1
解决办法
1万
查看次数

错误:警告:无法访问“/etc/gitconfig”:通过 gh repo 克隆克隆 GitHub 存储库时,权限被拒绝

在 Ubuntu 20.04 上,我gh通过以下方式安装了 CLI 工具:

sudo snap install gh
Run Code Online (Sandbox Code Playgroud)

然后,尝试gh repo clone公共存储库导致了错误:

Error: warning: unable to access '/etc/gitconfig': Permission denied
Run Code Online (Sandbox Code Playgroud)

这是通过 HTTPS 和使用新生成的密钥的 SSH 发生的。像这样的相关 QA指出了安装可能出现问题的可能性。

如何解决这个问题,以便我可以使用SSH 密钥获得与旧克隆最接近的东西?

github-cli

8
推荐指数
1
解决办法
4129
查看次数

如何在 GitHub Action 中使用 GitHub cli (gh) 通过 Github 进行身份验证并创建 PR?

在 GitHub 操作中,我使用脚本创建一个文件。然后我可以使用 git 创建一个分支,添加文件,提交文件并将分支推送到存储库。全部使用git。

然后我想在我的操作中创建 PR,因此我使用 GH CLI。在我的步骤中,这是与 PR 相关的部分:

echo "GH CLI Auth"
gh auth login --with-token < ${{ secrets.GITHUB_TOKEN }}
echo "Create PR"
gh pr create --reviewer myhandle --title "Show Notes ${{ env.NEWFILE_PATH }}" --body "Show Notes ${{ env.NEWFILE_PATH }}"
Run Code Online (Sandbox Code Playgroud)

但我收到错误。

GH CLI Auth
/home/runner/work/_temp/<GUID_CENSORED>.sh: line 13: ***: No such file or directory
Error: Process completed with exit code 1.
Run Code Online (Sandbox Code Playgroud)

我授予 GitHub 令牌对代码和拉取请求的写入权限。

permissions:
  contents: write
  pull-requests: write
Run Code Online (Sandbox Code Playgroud)

我很困惑。谢谢您的帮助!

github-actions github-cli

8
推荐指数
1
解决办法
6606
查看次数

用于 github 操作的 Google 服务 json 文件?

我目前正在开发一个 android 项目,我使用 github action 来测试该项目。但每当构建时,都会因找不到文件而出现错误google-services.json

产生的错误如下

File google-services.json is missing. The Google Services Plugin cannot function without it.
Run Code Online (Sandbox Code Playgroud)

现在,我不想google-services.json在 github 上提交或上传文件。那么,有没有其他方法可以解决这个问题呢?

linux android firebase github-actions github-cli

8
推荐指数
2
解决办法
4063
查看次数

在 GitHub CLI 中切换用户

我正在使用 GitHub CLI 和MinGit for Windows

当我注销 GitHub CLI 并gh auth logout通过调用 git 使用不同的帐户重新登录时,gh auth login配置不会更改。

当我输入时,条目git config --global --list仍然指向旧帐户。因此,当我提交时,看起来提交是由我的旧帐户进行的。user.nameuser.email

我知道我可以输入git config --global user.name "username"并更改名称,但如何使用 GitHub CLI 正确执行此操作?

如果我无法使用 GitHub CLI 执行此操作,我需要user.name更改user.email的唯一两个条目才能作为我的新帐户提交?

git windows-10 github-cli

7
推荐指数
2
解决办法
5266
查看次数

现在 github 中 repos 的 ssh URL 在哪里?

我刚刚进入 github 存储库来获取它的 ssh URL,我看到的只是 https 和使用 github-cli 克隆的说明。我知道我可能可以从 https 中弥补 ssh-one,但为什么缺少 ssh 呢?

github git-clone github-cli

7
推荐指数
1
解决办法
2429
查看次数

使用 gh 创建存储库环境

是否可以使用cli 为存储库https://github.com/org/repo/settings/environments创建新环境gh

environment我在手册中可以找到的唯一提及是在这里https://cli.github.com/manual/gh_secret_set,它说你可以为现有环境分配一个秘密,但似乎必须手动创建环境。

github github-cli

7
推荐指数
1
解决办法
2037
查看次数