2012-06-15 15 views
1

我是github noob,但我想使用它,因爲開源方面。github沒有上傳我創建的新文件

我設法按照教程,最初填寫一個存儲庫,並從我的eclipse android工作區上載文件。現在我添加了幾個文件,並在我的ubuntu終端中嘗試了以下git命令。隨時隨地

cd Dropbox/android/workspace 
git add . //figured this would add the new files? 
git commit -m 'changed a few things...' 
git push origin master 

任何錯誤消息,當我看到GitHub的網站,我看到了我在上面輸入提交信息的文件夾.metadata。其他文件夾沒有此消息。我尋找我的新文件,但他們不在github上。

我是否錯過了非常容易的事情?

下面是終端輸出:

git add -A 

沒有。

git commit -m 'blah' 

[master 41642e3] new fiels 
16 files changed, 57 insertions(+) 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/.markers.snap 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/.syncinfo.snap 
delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/org.eclipse.jdt.core/state.dat 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/.markers.snap 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/.syncinfo.snap 
delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/org.eclipse.jdt.core/state.dat 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/.markers.snap 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/.syncinfo.snap 
delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/org.eclipse.jdt.core/state.dat 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/.markers.snap 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/.syncinfo.snap 
delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/org.eclipse.jdt.core/state.dat 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap 
create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.snap 
create mode 100644 .metadata/.plugins/org.eclipse.team.cvs.core/.running 

git push origin master 

To https://github.com/killerpixler/Android-Application-Development.git 
    bb1d6a5..41642e3 master -> master 
+0

把你的Git倉庫中的Dropbox目錄通常是一個壞理念; Dropbox可能會損壞存儲庫。 – 2012-06-15 15:41:52

回答

1

嘗試git add -A而不是git add .。由於您的代碼位於當前目錄下的目錄中,因此我會假設git add。僅添加當前目錄中的目錄,但它不是遞歸的,並且不會添加這些目錄下的文件。 git add -A將添加所有更改的文件。您可以通過創建一個.gitignore文件來明確說明不需要添加的內容(即/bin/gen目錄),您可以通過-A選項排除某些文件的添加。

+0

我做了,再次沒有錯誤,但它仍然無法正常工作。 (我做了添加,提交,推送) – Killerpixler

+0

你可以在調用'添加,提交,推送'時發佈終端中的打印內容嗎? – asenovm

+0

這是不正確的。 'git add .'是遞歸的。 'git add -A'是'git add。 git add -u'。閱讀http://stackoverflow.com/questions/572549/difference-of-git-add-a-and-git-add –

0

如果是你正在談論的空文件夾 - 這是正常的行爲。默認爲,不會添加空文件夾。你可能會迫使它這樣做通過以下步驟:

創建一個空的目錄中名爲.gitignore文件,有以下兩行:

# Ignore everything in this directory 
* 
# Except this file 
!.gitignore 
+0

它不是。我在我的android項目中創建了新的.java文件,並希望將它們推送到github上 – Killerpixler

+0

嘗試顯式添加文件:'git add DIR/*。java',然後使用'git status'檢查狀態。如果你得到「沒有提交」作爲響應,檢查日誌'git log DIR/FILE.java'。如果這個文件已經提交,它只會說「沒有提交」。 –

+0

檢查你當前使用的分支:'git branch'。它應該顯示'* master',這意味着,星號分支(主)當前被啓用 - 應該是這種情況。 –