Di solito, ho appena eseguitoGit impedisce spingendo dopo che modifica un commit
git add file
git commit
git push
ma se modificare l'impegno prima spingendola (con git commit --amend
), la prossima spinta viene a mancare con
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Come posso lasciare che Git spinga le modifiche senza fondere i rami? Ho solo un ramo (master
) e io sono l'unica persona che usa questo repository quindi perché sta dicendo questo?
git branch -a:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
EDIT: Utilizzando gitk HEAD @{u}
, vedo che ho 2 rami, uno con l'originale commesso e un altro con il commit modificato.
possibile duplicato di [Come posso inviare il commit modificato al repository git remoto?] (Http://stackoverflow.com/questions/253055/how-do-i-push-amended-commit-to-the-remote -git-repo) – Deebster
@Deebster La domanda che hai collegato riguardava la modifica di un commit già trasferito al telecomando, sto modificando un commit che non è stato ancora spinto. – minerz029
'Ho solo un ramo (master) e sono l'unica persona che usa questo repo' e' Vedo che ho 2 rami, uno con il commit originale e un altro con il commit modificato. È in conflitto, puoi per favore spiega cosa hai fatto esattamente –