-1

I have a branch named code-clean-and-proper-commenting there is 120 commit in this branch, I have pushed this branch on my upstream, Now I have to combine that 120 commits into one single commit and I have to re pushed the changes into my upstream's code-clean-and-proper-commenting branch.

How do I do this things?

mizan3008
  • 369
  • 3
  • 17
  • 2
    Possible duplicate of [Combining Multiple Commits Into One Prior To Push](http://stackoverflow.com/questions/5721566/combining-multiple-commits-into-one-prior-to-push) – Abizern Dec 21 '16 at 17:04

1 Answers1

1

I think you rebasing your branch can fix your problem.You can read more about rebasing from here. On the top of your branch you can do :

git rebase -i HEAD~120

Where -i option is for interactive rebasing. You edit the commit history in any way you want. And after that you can force push to your upstream server

git push origin code-clean-and-proper-commenting -f

I hope that helps.

Rohan Kumar
  • 5,427
  • 8
  • 25
  • 40
  • Thanks @Rohan Kumar and here is also a simple solution- http://ndlib.github.io/practices/one-commit-per-pull-request/ – mizan3008 Jan 08 '17 at 11:45
  • found another best solution: http://ndlib.github.io/practices/one-commit-per-pull-request/ – mizan3008 Feb 08 '17 at 10:00