2010-11-21 18 views
4

Je suis sûr que c'est une solution assez facile, mais je ne suis pas sûr pourquoi mes poussées à GitHub échouent.Que puis-je faire quand git push échoue avec ... "local out of date"?

En ce moment, il ressemble à:

$ git push origin master 
To [email protected]:user_name/project_name.git 
! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to '[email protected]:user_name/project_name.git' 
To prevent you from losing history, non-fast-forward updates were rejected 
Merge the remote changes before pushing again. See the 'Note about 
fast-forwards' section of 'git push --help' for details. 

Et:

$ git remote show origin 
* remote origin 
    Fetch URL: [email protected]:user_name/project_name.git 
    Push URL: [email protected]:user_name/project_name.git 
    HEAD branch: master 
    Remote branch: 
    master tracked 
    Local ref configured for 'git push': 
    master pushes to master (local out of date) 

Aussi, lorsque je tente un git pull:

$ git pull 
You asked me to pull without telling me which branch you 
want to merge with, and 'branch.master.merge' in 
your configuration file does not tell me, either. Please 
specify which branch you want to use on the command line and 
try again (e.g. 'git pull <repository> <refspec>'). 
See git-pull(1) for details. 

If you often merge with the same branch, you may want to 
use something like the following in your configuration file: 

    [branch "master"] 
    remote = <nickname> 
    merge = <remote-ref> 

    [remote "<nickname>"] 
    url = <url> 
    fetch = <refspec> 

See git-config(1) for details. 

Qu'est-ce que je fais pour faire cet état ... et que dois-je faire pour le réparer?

Répondre

6

Pour tirer de distance

git pull origin master