Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git-无法将文件添加到repo_Git_Github_Git Add - Fatal编程技术网

Git-无法将文件添加到repo

Git-无法将文件添加到repo,git,github,git-add,Git,Github,Git Add,我是Git和GitHub的新手 我已经在Github中创建了一个公共存储库用户名/test_文件 在本地计算机上,我创建了一个类似的文件夹/users/username/test\u文件 我创建了一个新的test.md文件,并将其保存在本地计算机上的/test_文件下。 然后我运行了以下命令: git init git remote add origin https://github.com/username/test_files git add . git commit -m "New fil

我是Git和GitHub的新手

我已经在Github中创建了一个公共存储库用户名/test_文件

在本地计算机上,我创建了一个类似的文件夹/users/username/test\u文件 我创建了一个新的test.md文件,并将其保存在本地计算机上的/test_文件下。 然后我运行了以下命令:

git init
git remote add origin https://github.com/username/test_files
git add .
git commit -m "New file has been added"
git push origin master
这不会将文件推送到GitHub。 我认为步骤的顺序是正确的。我在add和commit之后做了一个git状态,它确实显示它添加了test.md文件


我做错了什么?

我解决了这个问题。看起来像是我本地没有的远程包含的工作。所以我运行了下面的git pull和git push originmaster。现在该文件被推送到GitHub。谢谢你的帮助。