远程:Mac 终端中未找到存储库错误

Dav*_*vid 10 git github git-push git-remote

我是 git 新手。我有一个私人存储库,现在我想将本地存储库的更改推送到远程存储库。但是,我收到错误:

remote: Repository not found.
fatal: repository 'https://github.com/co-csp/csm.git/' not found
Run Code Online (Sandbox Code Playgroud)

可能会导致这些错误的原因是什么,请帮我解决它,我使用的是Mac 终端。我的github 配置文件中的用户名是john2git config user.namegit config user.username两者都给出john2,所以用户名似乎是正确的......

rsl*_*slj 7

如果您使用私有存储库,请执行以下操作:

  1. git 远程 rm 原点
  2. git 远程添加源 https://user@github.com/co-csp/csm.git
  3. git 克隆 https://user@github.com/co-csp/csm.git

这将提示您输入 GitHub 密码,并且应如下所示。

克隆到“csm”...“https://user@github.com”的密码:


ato*_*ULL 0

这里你有两个选择。一种选择是使用git clone,另一种选择是git init

选项 1:使用git clone. 在一个新的空文件夹中输入以下命令: git clone https://github.com/co-csp/csm.git. 你已经准备好出发了。

选项 2:在项目文件夹中,键入git init. 这将启动一个空的新存储库。它将.git在里面创建一个文件夹。输入 转到此文件夹cd .gitconfig使用您最喜欢的编辑器(我的是)打开文件vim。您将在那里看到以下内容:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
Run Code Online (Sandbox Code Playgroud)

在下面附加以下内容:

[remote "origin"]
        url = https://github.com/co-csp/csm.git
        fetch = +refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)