简体   繁体   English

GIT - 推送到(GitHub)原始主机什么都不做

[英]GIT - pushing to (GitHub) origin master does nothing

I have forked someone's GIT repository:我已经分叉了某人的 GIT 存储库:

https://github.com/nippysaurus/toodledo-objc

Cloned it to my local machine, showing the origin with the following information:将其克隆到我的本地计算机上,并显示具有以下信息的来源:

* 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)

When I push my changes to "origin master" git prints "everything up to date", but nothing it updated in my GitHub repo.当我将更改推送到“原始主机”时,git 会打印“一切都是最新的”,但在我的 GitHub 存储库中没有任何更新。

What is going on here?这里发生了什么?

EDIT:编辑:

Someone is suggesting that I check thay the files were actually commited... the files were commited, I assure you.有人建议我检查这些文件是否已实际提交...文件已提交,我向您保证。

commit 0d3a21616d82c8e5a89baaf85d745fc2cfdf614f
Author: nippysaurus <nippysaurus@example.com>
Date:   Wed Jun 1 13:19:14 2011 +1000

    updated readme

This is the file that was updated:这是更新的文件:

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:

Also, I can see that the local version of the file is very different to the version on GitHub, the changes are definately being added to my local repo, but are not being pushed to the remote repo.此外,我可以看到该文件的本地版本与 GitHub 上的版本非常不同,这些更改肯定会添加到我的本地存储库中,但不会推送到远程存储库中。

It might be the case that you are on another branch than the master branch, then type:可能是您在 master 分支之外的另一个分支上,然后键入:

git push origin HEAD:master

so git understands that you want to push up current HEAD and not the master branch.所以 git 明白你想推高当前的 HEAD 而不是 master 分支。

When it says Up to date it means your local repository and your remote repository are one and the same, that is you have not made any changes to your local repo that needs to be pushed to the remote repo.当它说最新时,这意味着您的本地存储库和远程存储库是相同的,即您没有对需要推送到远程存储库的本地存储库进行任何更改。

If you have indeed changed the files then you must have forgot to commit it.如果您确实更改了文件,那么您一定是忘记提交了。

If you had created new files then you must add it.如果您创建了新文件,则必须添加它。 To add files use添加文件使用

git add .

then to commit all the edited files use然后提交所有已编辑的文件使用

git commit -am "Commit message"

then do然后做

git push origin master

Use these commands.使用这些命令。 Suppose test.md is the new file you created and you want to push it with the message "Testing"假设test.md是您创建的新文件,并且您希望使用消息“正在测试”推送它

$ git add test.md
$ git commit -a -m "Testing"
$ git push origin master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM