0

I am new to Git and I haven't been able to practice it a lot. So i am asking this question here before i issue this command to our main repo.

I am at branch featureX and now i want to rebase with master (with all the merge history) ... and then push it up stream into my branch. I have read couple of things and i came up with the following set of commands

  1. git rebase --preserve-merges master featureX
  2. git push -u origin featureX

However, given there is no place i can test it out I am not sure if its the right command to issue on our main repo.

Mykola
  • 3,343
  • 6
  • 23
  • 39
Em Ae
  • 8,167
  • 27
  • 95
  • 162
  • 1
    If you are unsure, clone the repo and try the operation in question on the clone. Examine the result. If it is satisfactory, perform the same operation on the original repo or simply replace it with the clone. – das-g Feb 08 '16 at 21:31

1 Answers1

1

Rebasing rewrites history. So if you want to preserve history exactly, don't rebase. Merge instead.

das-g
  • 9,718
  • 4
  • 38
  • 80