新手github用户试图将文件推送到github上的回购

问题描述:

嗨大家:这是我第一次写这个清单,所以请原谅新手问题和任何其他规则,我没有遵循。新手github用户试图将文件推送到github上的回购

我正在开发fedora linux,并尝试用git来自己亲自实验,但真的是github。所以,我遵循各种教程并创建了一个名为markleeds2/bclean的github帐户和存储库。我还添加了ssh公钥,这似乎工作正常。回购没有任何文件。所以,我离开了github并进入了linux命令行,以下是我根据一个教程找到的步骤,我找到了我不记得的地方。显然,我做错了什么,因为我在尝试推送文件时遇到错误。非常感谢您提供任何帮助。


P.S:因为它没有“bclean”我有一种感觉,我的远程Git在最后添加起源命令是不正确的 。

#========================================================================================== 

:~/research/equity/projects/git_hub/git> mkdir test 
:~/research/equity/projects/git_hub/git> cd test 
:~/research/equity/projects/git_hub/git/test> dir 
total 0 


:~/research/equity/projects/git_hub/git/test> git init 
Initialized empty Git repository in /home/markleeds/research/equity/projects/git_hub /git/test/.git/ 

:~/research/equity/projects/git_hub/git/test> touch README 
:~/research/equity/projects/git_hub/git/test> git status 
# On branch master 

初始提交

未跟踪文件: (使用 “混帐添加...” 在什么将致力于包括)

README 

没有加入到承诺,但未跟踪文件存在(使用“git add”来跟踪)

:~/research/equity/projects/git_hub/git/test> git add README 
:~/research/equity/projects/git_hub/git/test> git status 
On branch master 

Initial commit 

Changes to be committed: 
    (use "git rm --cached <file>..." to unstage) 

     new file: README 


:~/research/equity/projects/git_hub/git/test> git commit -m 'first commit' 
[master (root-commit) 676f27d] first commit 


:~/research/equity/projects/git_hub/git/test> git remote add origin  [email protected]:markleeds2/test.git 

:~/research/equity/projects/git_hub/git/test> git push -u origin master 
ERROR: Repository not found. 
fatal: The remote end hung up unexpectedly 
+0

看来你没有在GitHub上创建的存储库,也许在'git的一个错字远程添加原产[email protected]:markleeds2 /测试。 git'? – eagleoneraptor 2012-03-11 04:33:52

确保你实际上创建了test存储库在您的GitHub帐户。

接下来,只要按照步骤,他们给你:

mkdir test 
cd test 
git init 
touch README 
git add README 
git commit -m 'first commit' 
git remote add origin [email protected]:Blender3D/test.git 
git push -u origin master 
+0

谢谢。我的github帐户上的存储库名称叫做markleeds2/bclean。我应该更改名称来测试吗?谢谢。 – 2012-03-11 04:33:48

+0

当您通过GitHub创建存储库时,您应该已经根据这些说明获得了空白页面。在我的代码中,只需更改'test => bclean'并将我的用户名与您的用户名交换。 – Blender 2012-03-11 04:35:07

+0

好的。谢谢。我确实看到了这些说明,但我认为测试涉及到linux目录。我会尝试并让你知道。 – 2012-03-11 04:36:43