inno-code / simplephp

Project to illustrate basic PHP HTML CSS coding concepts for beginners.
8 stars 9 forks source link

Git repo rejected my push #14

Closed taono closed 9 years ago

taono commented 9 years ago

@zoelogic please take a look at the following message. After trying to create a folder at root directory for inno-code/simplephp, my push got rejected.

In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': git config --global push.default matching Password for 'https://git config --global push.default matching@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/taono/simplephp.git/' tao@tao-ubuntu:/var/www/html/simplephp/skeleton$ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': taotang@icloud.com Password for 'https://taotang@icloud.com@github.com': To https://github.com/taono/simplephp.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/taono/simplephp.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. tao@tao-ubuntu:/var/www/html/simplephp/skeleton$ git pull origin master https://github.com/taono/simplephp.git fatal: Invalid refspec 'https://github.com/taono/simplephp.git' tao@tao-ubuntu:/var/www/html/simplephp/skeleton$ git pull origin master https://github.com/taono/simplephp fatal: Invalid refspec 'https://github.com/taono/simplephp' tao@tao-ubuntu:/var/www/html/simplephp/skeleton$ git pull origin master https://github.com/inno-codo/simplephp fatal: Invalid refspec 'https://github.com/inno-codo/simplephp' tao@tao-ubuntu:/var/www/html/simplephp/skeleton$ ^C tao@tao-ubuntu:/var/www/html/simplephp/skeleton$

zoelogic commented 9 years ago

hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull should solve this.

http://stackoverflow.com/questions/19439501/git-pull-origin-master-returns-fatal-invalid-refspec

taono commented 9 years ago

problem solved

zoelogic commented 9 years ago

Above stackoverflow link has the explanation of why it does not work.

taono commented 9 years ago

thanks.