Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT - pushing to (GitHub) origin master does nothing

Tags:

git

github

I have forked someone's GIT repository:

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

Cloned it to my local machine, showing the origin with the following information:

* remote origin
  Fetch URL: https://[email protected]/nippysaurus/toodledo-objc.git
  Push  URL: https://[email protected]/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.

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 <[email protected]>
Date:   Wed Jun 1 13:19:14 2011 +1000

    updated readme

This is the file that was updated:

commit 0d3a21616d82c8e5a89baaf85d745fc2cfdf614f
Author: nippysaurus <[email protected]>
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.

like image 348
Nippysaurus Avatar asked Jun 01 '11 03:06

Nippysaurus


People also ask

Why git push origin master is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

How do I force git to push origin?

To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch).

What does git push origin master -- force do?

The git push --force -u origin command overrides this restriction in Git, meaning it allows you to forcefully overwrite the commit history of your local branch to the remote repository branch.


3 Answers

It might be the case that you are on another branch than the master branch, then type:

git push origin HEAD:master

so git understands that you want to push up current HEAD and not the master branch.

like image 188
ralphtheninja Avatar answered Oct 09 '22 23:10

ralphtheninja


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
like image 22
swordfish Avatar answered Oct 09 '22 22:10

swordfish


Use these commands. Suppose test.md is the new file you created and you want to push it with the message "Testing"

$ git add test.md
$ git commit -a -m "Testing"
$ git push origin master
like image 20
Safwan Avatar answered Oct 10 '22 00:10

Safwan