I checked out 'production_branch' then did a merge of 'master_branch for_production_branch' there were massive conflicts. 'production_branch' has been deployed to production. But the conflicts require a more experienced eye. I need to get a critical patch (I will do it by hand) onto the production branch 'production_branch' so I can deploy.
git co 'production_branch' # =>
lib/tasks/foobar.rake: needs merge
vendor/plugins/acts_as_syncable/lib/active_record/whatever.rb: needs merge
error: you need to resolve your current index first
and
git co 'master_branch for_production_branch'
lib/tasks/foobar.rake: needs merge
vendor/plugins/acts_as_syncable/lib/active_record/whatever.rb: needs merge
error: you need to resolve your current index first
How can I get back to 'production_branch' in my working directory so I can deploy a simple critical fix.
You can use
git merge --abort
to abort your current merge action and revert to the situation before your started the merge. See git merge documentation for more details.
Note that it will throw away any changes your made, but I suppose this is not a problem in your current situation...
To blow away all the changes and set to prior to merge
git reset --hard commitsha
Here commitsha is the sha id of git commits.
You can use gitk
or git log
to check state of your branch and figure out commit_sha
Update
or on branch git reset --hard production_branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With