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.name
,git config user.username
两者都给出john2
,所以用户名似乎是正确的......
如果您使用私有存储库,请执行以下操作:
这将提示您输入 GitHub 密码,并且应如下所示。
克隆到“csm”...“https://user@github.com”的密码:
这里你有两个选择。一种选择是使用git clone
,另一种选择是git init
。
选项 1:使用git clone
. 在一个新的空文件夹中输入以下命令:
git clone https://github.com/co-csp/csm.git
. 你已经准备好出发了。
选项 2:在项目文件夹中,键入git init
. 这将启动一个空的新存储库。它将.git
在里面创建一个文件夹。输入 转到此文件夹cd .git
。config
使用您最喜欢的编辑器(我的是)打开文件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)
归档时间: |
|
查看次数: |
31964 次 |
最近记录: |