使用“travis encrypt-file”时无法弄清楚 GitHub 存储库名称

gat*_*nul 3 github travis-ci

当我使用travis encrypt-file命令时,抛出错误:

Can't figure out GitHub repo name. Ensure you're in the repo directory, or specify the repo name via the -r option (e.g. travis <command> -r <owner>/<repo>)

如何使用 travis 命令指定 repo 名称?我在 travis 的文档中没有找到

Von*_*onC 5

lib/travis/cli/repo_command.rb 中可以看到类似但更完整的消息

Can't figure out GitHub repo name. 
Ensure you're in the repo directory, or specify the repo name via the -r option (e.g. `travis <command> -r <owner>/<repo>`)"
GitHub repo name is invalid, it should be on the form 'owner/repo'
Run Code Online (Sandbox Code Playgroud)

所以在你的情况下:

travis encrypt-file -r <owner>/<repo>
Run Code Online (Sandbox Code Playgroud)

或者:

cd /path/to/GitHub/cloned/repo/locally
travis encrypt-file 
Run Code Online (Sandbox Code Playgroud)

(因为在最后一种情况下,git remote -v显示了 github 远程 repo url)

说到远程,J0hnG4lt在评论中提到:

由非标准远程名称对我造成的。
Travis 希望遥控器被称为origin”。