Reputation: 48606
I know that i must study git more thoroughly, it seems very interesting anyway, but i currently have a problem. I have a master repository and a branch one that represents a specific feature of my software.
I would normally change the master repository and just merge the changes to the feature one and only make changes to the feature one, if i just wanted to add something to that feature.
However, i accidentally made some changes, that had to be made on the master branch, to the feature one. Well, ok, it was just a few changes up to that time, so i merged the featured branch to the master(probably a very bad decision) and just changed the master to reflect the previous state.
This meant that i had to delete and change files that were previously ONLY on the featured branch. Now, this worked, but has a problem. The master branch now has a history of that files and when i try to merge the master changes to the feature, it actually removes needed nodes(because of my previous error merge).
Any ideas on how this can be resolved ?
P.S. In simpler words, i would like to merge master to my feature branch so that they are synced, but i actually don't want to see those changed on my featured branch.
Upvotes: 2
Views: 105
Reputation: 4776
If I understand, you want to merge master to your feature branch so that it appears merged in the history), but not change any of the content of your feature branch.
To do this, use the ours
merge strategy:
git merge -s ours master
Upvotes: 1