Ho un repository git locale sulla mia workstation, che mi spingono ad una posizione set in modo che posso tirare verso il basso per il mio computer portatile tramite git pull remote dropbox
.git push fallito dopo 'git ripristinare HEAD --hard ~ 1' di repo locale
Ieri ho controllato una modifica sulla mia stazione di lavoro, l'ho impegnata e git push dropbox
'ed it. Non ho fatto un git pull
dal mio portatile perché sospettavo che avrei finito per buttare via quel commit.
Oggi ho deciso di buttare via che commettono, così sulla mia workstation ho fatto:
git reset --hard HEAD~1
Fin qui, tutto bene. Ora voglio spingere questo backup su Dropbox, in modo che sul mio computer portatile posso unire e commettere da lì. Così sulla mia workstation ho provato:
git push dropbox
E git lamentato che:
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '\My Dropbox\dev\repos\xcast.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
Come faccio ad avere il mio worstation e Dropbox di nuovo in sincronia di nuovo?
Ci sono ripercussioni negative nel fare ciò? –
@Grunch: sì, si perde il commit nel telecomando. Se lo hai condiviso con altri, le storie potrebbero divergere. –
@Grunch Sì, forza la forza solo se sei sicuro che nessuno ha già effettuato le modifiche (o sei l'unico con accesso) – jli