【问题标题】:How to initialize a GitHub repo directly from Atom editor?如何直接从 Atom 编辑器初始化 GitHub 存储库?
【发布时间】:2021-06-01 17:59:02
【问题描述】:

我正在使用 Atom 文本编辑器,我想将它连接到 GitHub。当我尝试从 Atom 初始化并发布一个 repo 到 GitHub 时,它会抛出一个错误 -

fatal: 'origin' 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.

在网上没有找到任何好的东西。尝试使用apm和命令行重新安装github包,但报错:Failed to delete github: No package.json found at C:\Users\User\.atom\packages\github\package.json

系统 - Windows 10、Atom - 最新版本。

感谢您的帮助!

【问题讨论】:

    标签: git github atom-editor


    【解决方案1】:

    切换到命令行,只是为了检查来源是什么:

    cd /path/to/local/repository
    git remote -v
    

    当我尝试初始化时

    单独初始化不会设置原点:需要手动添加:

    cd /path/to/local/repository
    git remote add origin https://url/remote/repository
    

    【讨论】:

    • 这不是关于克隆,而是关于创建和推送一个 repo。
    • @Pythonista 好的。我已经修改了答案以解决推送部分,这取决于定义的“原点”。
    【解决方案2】:

    知道了。您应该使用 GitHub Desktop 应用程序发布一个 repo,它运行良好,然后 Atom 将运行。

    【讨论】:

    • 这也确实有效:GitHub 桌面应用程序将设置原点。
    猜你喜欢
    • 2020-01-05
    • 2014-12-13
    • 2011-01-05
    • 2020-03-27
    • 1970-01-01
    • 2015-01-29
    • 2016-07-30
    • 2021-07-30
    • 1970-01-01
    相关资源
    最近更新 更多