Desidero eseguire lo schiacciamento di due ultimi commit con messaggi di commit "first" e "second". Primo tiro padrone allora io uso il comandodesidera eseguire lo squash di più commit in github
git rebase -i HEAD~2 master
Mi sia mostra commette in un editor come questo:
pick first
pick second
Poi posso cambiare questo editor come:
pick first
squash second
Dopo aver salvato le modifiche ho ricevuto questo messaggio:
Successfully rebased and updated refs/heads/master.
Ha cambiato nulla nel master remoto. Per applicare le modifiche che uso il comando git push
ed ha ottenuto il seguente errore:
To https://github.com/aneelatest/GITtest.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/test/GITtest.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Poi ho di nuovo eseguire il comando git pull
ed unione master origine e fare un altro commit con questo messaggio di commit:
Merge branch 'master' of https://github.com/aneelatest/GITtest
Dopo questo, quando eseguo git push, schiaccia i due commit in uno con il messaggio "first". Il problema è che in master a distanza, ora ho quattro commit:
first
second
Merge branch 'master' of https://github.com/test/GITtest
first
dove voglio commettere un solo che è la schiacciata con una messaggio di commit "prima". Qualche idea in cui sto facendo un errore ??
Non devi più schiacciare: il proprietario può farlo per te (da marzo 2016): vedi http://stackoverflow.com/a/36377439/6309 – VonC