Was kann ich tun, wenn git push irgendwie ... „local out of date“?
-
26-09-2019 - |
Frage
Ich bin sicher, das ist eine ziemlich einfache Lösung, aber ich bin nicht sicher, warum meine Schübe zu GitHub versagen.
Im Moment sieht es so aus:
$ git push origin master
To git@github.com:user_name/project_name.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com: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.
Und:
$ git remote show origin
* remote origin
Fetch URL: git@github.com:user_name/project_name.git
Push URL: git@github.com: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)
Auch wenn ich versuche, einen 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.
Was habe ich getan, um diesen Zustand zu verursachen ... und was soll ich tun, um es zu beheben?
Lösung
Um von Remote
ziehengit pull origin master
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow