![](/img/trans.png)
[英]Why 'git push origin master' is pushing old files to GitHub?
[英]GIT - pushing to (GitHub) origin master does nothing
我已經分叉了某人的 GIT 存儲庫:
https://github.com/nippysaurus/toodledo-objc
將其克隆到我的本地計算機上,並顯示具有以下信息的來源:
* remote origin
Fetch URL: https://nippysaurus@github.com/nippysaurus/toodledo-objc.git
Push URL: https://nippysaurus@github.com/nippysaurus/toodledo-objc.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
當我將更改推送到“原始主機”時,git 會打印“一切都是最新的”,但在我的 GitHub 存儲庫中沒有任何更新。
這里發生了什么?
編輯:
有人建議我檢查這些文件是否已實際提交...文件已提交,我向您保證。
commit 0d3a21616d82c8e5a89baaf85d745fc2cfdf614f
Author: nippysaurus <nippysaurus@example.com>
Date: Wed Jun 1 13:19:14 2011 +1000
updated readme
這是更新的文件:
commit 0d3a21616d82c8e5a89baaf85d745fc2cfdf614f
Author: nippysaurus <nippysaurus@example.com>
Date: Wed Jun 1 13:19:14 2011 +1000
updated readme
diff --git a/README.mdown b/README.mdown
index fb8ee14..a71aa57 100644
--- a/README.mdown
+++ b/README.mdown
@@ -3,7 +3,7 @@ toodledo-objc
An _unofficial_ toodledo-API implementation in ObjectiveC.
-This library currently uses [version 1.0 of the API](http://www.toodledo.com/info/api_doc.php "Toodledo API 1.0 spec") which has been offic
+This library currently uses [version 1.0 of the API](http://www.toodledo.com/info/api_doc.php "Toodledo API 1.0 spec") which has been offic
Supported:
此外,我可以看到該文件的本地版本與 GitHub 上的版本非常不同,這些更改肯定會添加到我的本地存儲庫中,但不會推送到遠程存儲庫中。
可能是您在 master 分支之外的另一個分支上,然后鍵入:
git push origin HEAD:master
所以 git 明白你想推高當前的 HEAD 而不是 master 分支。
當它說最新時,這意味着您的本地存儲庫和遠程存儲庫是相同的,即您沒有對需要推送到遠程存儲庫的本地存儲庫進行任何更改。
如果您確實更改了文件,那么您一定是忘記提交了。
如果您創建了新文件,則必須添加它。 添加文件使用
git add .
然后提交所有已編輯的文件使用
git commit -am "Commit message"
然后做
git push origin master
使用這些命令。 假設test.md
是您創建的新文件,並且您希望使用消息“正在測試”推送它
$ git add test.md
$ git commit -a -m "Testing"
$ git push origin master
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.