2011-09-14 37 views
1

我試圖將更改從本地機器推送到我的github回購,並且它不工作。試圖將更改推送到github回購

我已在本地承諾:

[email protected]:~/PycharmProjects/TrendFollowing$ git commit -m "Change the underlying data type for time series from a list of dictionary entries to numpy arrays" 
# On branch master 
# Changed but not updated: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: trendfollowing/breakouts.py 
# modified: trendfollowing/extrema.py 
# modified: trendfollowing/test/breakouts_test.py 
# modified: trendfollowing/test/timeseries_extrema_test.py 
# modified: trendfollowing/test/timeseries_test.py 
# modified: trendfollowing/timeseries.py 
# 
no changes added to commit (use "git add" and/or "git commit -a") 

接下來,我想(只是要確定):

[email protected]:~/PycharmProjects/TrendFollowing$ git remote add origin [email protected]:natereed/trendfollowing.git 
fatal: remote origin already exists. 

這個命令是由github上提供的,當我設置回購(我認爲)。我創建了一個測試項目,並與我回購的名稱取代「測試」:

[email protected]:~/PycharmProjects/TrendFollowing$ git push -u origin master 
Branch master set up to track remote branch master from origin. 
Everything up-to-date 

爲什麼不推我的變化?

編輯:新增失蹤的錯誤消息(「不加修改提交」)

+0

你確定'git commit'的輸出沒有以下面的錯誤結束嗎? '沒有更改添加到提交(使用「git add」和/或「git commit -a」)' –

+0

答案已經在您的屏幕上:-)(使用「git add ...」更新將提交的內容) – Daan

+0

實際上,我已經使用「git add」添加了所有新文件 - 這就是爲什麼我感到困惑。我認爲這是刪除沒有添加的文件?或者我必須在每個添加的文件上運行「git add 」兩次? –

回答

12

您還沒有COMMITED。 git commit -m只會提交暫存區中的內容。使用git commit -a -m或使用git add將文件添加到暫存區域。

+0

你是對的,有沒有變化,因爲他們沒有上演。我使用了git commit -a -m並修復了它。 –

+0

「git add ; git commit -m」和「commit -a -m」有什麼區別嗎? –

+0

@Nate -a開關將在所有已知的git文件上調用git add(或rm)。這意味着如果一個文件當前沒有版本化,你不會使用'git commit -a'來添加它,但需要手動添加它。 – pmr