1

Let's say I'm working on a branch 'master'. It's clean. I made another branch 'task' and added a new table to database. I commited the changes but didn't push to remote repo.

Then I switched to the 'master' branch and make changes to db also. When I press git diff db/schema.rb I can see that the table was added to my schema, but I didn't add it in my 'master' branch which means I can see differences in schema.rb file but the migration itself is in a 'task' branch.

How do I commit and push the changes from 'master' branch?

Nadiya
  • 1,421
  • 4
  • 19
  • 34

1 Answers1

2

You should probably follow the following sequence:

  1. Rollback the new migrations in the master branch
  2. Switch to the task branch and rollback the migrations specific to that branch
  3. Switch back to the master branch and rerun the migration
Jerry
  • 874
  • 6
  • 15