I have a base repository that contains the default code. I want to keep changes that is specific to a customer, in another repository, so I forked the base repository and set the base repository as an upstream repository.

In this forked repository, I made the changes relevant for that customer, like GitHub actions for deployment, company logo image, etc.

However, when I now make changes to the base repository and try to merge that in the local repository, the changes get overwritten.

I am working on Windows with code written in Visual Studio.

How do I stop that from happening?

I have tried using .gitattributes files to specify merging strategies, but this seems to be ignored. Here are the steps I follow in a terminal:

  • Ensure there are no outstanding commits in my local repository.
  • Fetch upstream (git fetch upstream)
  • Pull in the changes from upstream (git merge upstream/main)
  • Handle the conflicts.
  • Push the changes (git push origin main)

At this point the local changes are "gone".

0

There are 0 best solutions below