2012-03-11 73 views
-1

嗨大家:這是我第一次寫這個清單,所以請原諒新手問題和任何其他規則,我沒有遵循。新手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

回答

1

確保你實際上創建了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