Git:向远程目录添加文件一直失败

Git:向远程目录添加文件一直失败,git,Git,所以我第一次尝试使用Github。我正在处理项目负责人为我创建的存储库 我去了我想要的目录 /Users/abrahammathew/Desktop/my_issues 我创建了目录 Abrahams-MBP:abiomed_issues abrahammathew$ git clone https://github.com/ml_projects/my_repo.git ... Checking connectivity... done. 初始化已完成 Abrahams-M

所以我第一次尝试使用Github。我正在处理项目负责人为我创建的存储库

我去了我想要的目录

/Users/abrahammathew/Desktop/my_issues
我创建了目录

Abrahams-MBP:abiomed_issues abrahammathew$ git clone https://github.com/ml_projects/my_repo.git
    ...
    Checking connectivity... done.
初始化已完成

Abrahams-MBP:my_issues abrahammathew$ git init
已将文件添加到我的本地存储库

Abrahams-MBP:my_issues abrahammathew$ git add my_data_extraction.py
首次提交

Abrahams-MBP:my_issues abrahammathew$ git commit -m "first commit"
远程添加了源代码

Abrahams-MBP:abiomed_issues abrahammathew$ git remote add origin https://github.com/abmathewks/my_repo.git
最后,我尝试将文件推送到github

Abrahams-MBP:my_issues abrahammathew$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/abmathewks/my_repo.git/' not found
所以最后一步不起作用。任何人都可以帮助诊断这个问题。我已经指定了正确的回购协议,所以我不确定为什么找不到它。这是我的本地目录和目录

Abrahams-MBP:my_issues abrahammathew$ ls -a
.               my_data_extraction.py
..              my_explore.py
.DS_Store       my_repo
.git
我也试过:

Abrahams-MBP:my_issues abrahammathew$ git push -u origin:master
ssh: Could not resolve hostname origin: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
还有一般的推送

Abrahams-MBP:my_issues abrahammathew$ git push 
remote: Repository not found.
fatal: repository 'https://github.com/abmathewks/my_repo.git/' not found

部分问题在于您正在执行几个不必要的步骤。其中一些可能相互冲突

要从头开始创建空回购,请使用

$ git init
若要将此新回购协议连接到现有回购协议,则可以执行以下操作

$ git remote add <name> <URL>
或者添加一个新的遥控器指向新的空白回购:

$ git remote add my-personal-repo <URL>
$git remote添加我的个人回购
正确创建存储库后,根据需要执行以下命令:

$ git add <file name>
$ git commit -m 'Some message'
$ git push
$git add
$git commit-m“一些消息”
$git推送

不应该是源代码:主代码吗?您已经添加了遥控器-为什么需要显式指定它?运行
git clone
然后运行
git init
是不正常的。正常顺序是
git clone
,然后是
cd
,进入克隆创建的存储库。请注意,
git clone
mkdir
+
cd
+
git init
+
git remote add
+
git fetch
+
git checkout
作为一个大型复合操作。sub命令在新的Git目录中运行,但完成后,您仍然不在新的Git目录中。1。您正在执行几个不必要的命令。2.您只创建了回购协议的本地副本。您没有在您的帐户下的GitHub上创建远程回购。
$ git remote add my-personal-repo <URL>
$ git add <file name>
$ git commit -m 'Some message'
$ git push