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:

  1. pushed bunch of code
  2. commit --amend
  3. commit --amend
  4. commit --amend
  5. pushed
  6. 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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -