git - Why should I have conflict after push->amend->amend->amend->push->pull? -
in question git prevents pushing after amending commit been mentioned that:
this should case if you're amending already-pushed commit
but did steps below:
- pushed bunch of code
- commit --amend
- commit --amend
- commit --amend
- pushed
- pull (conflict (content))
this conflict can happend in future too, don't understand why did conflict happen! shed light on process?
in step 4:
$ git commit --amend [dev cf0f21d] blahhh(blah) added date: wed sep 30 08:39:28 2015 +0330 5 files changed, 168 insertions(+), 1 deletion(-)
in step 5:
$ git push origin dev repo:~/something ! [rejected] dev -> dev (non-fast-forward) error: failed push refs 'repo:~/something' hint: updates rejected because tip of current branch behind hint: remote counterpart. integrate remote changes (e.g. hint: 'git pull ...') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details.
in steps 2, 3, 4 amending commit pushed in 1
commit amend amends last commit in repo. hence amending commit pushed in 1. need create new commit after (1), , can amend commit wish.
also, in step 5 should have got warning or did force-push
Comments
Post a Comment