0

I have create feature branch test and push commit 'Test1' to it. Next I have changed names of files in this commit and amend changes to commit 'Test1' locally.

The goal I want to achieve is to push this changes to remote feature branch where will be also then one commit with my changes.

My problem: When I tried to push my amended commit git told me that I had old changes. So I pull changes from remote. But then I had merge commit locally. If I push this commit and merge to remote will I have 3 commits? First one, amended and merge ? o.O

How can i achieve my goal ?

netmajor
  • 6,119
  • 13
  • 64
  • 97
  • Sounds like you wanted to _replace_ the old commit with the new one? If that's the case, you can force push with ```git push -f``` so that the previous existing revision on the remote branch is _forgotten about_. – eftshift0 Apr 12 '17 at 17:58
  • It sounds good, because only me works on that branch. Will it also works with few commits ? It override branch? – netmajor Apr 12 '17 at 18:00
  • ```git push -f``` will put on whatever remote branch yo are pushing onto to _magically_ have the content you are asking to have from your local repo ... be it one commit or 100. It makes no difference. It has to be done with some finesse because of other people are already working from the previous branch content they might get problems when they try to merge/push their changes. – eftshift0 Apr 12 '17 at 18:03

0 Answers0