Let us define "upstream" as an apache repo for which a remote was created:
git remote add upstream https://github.com/apache/spark.git
We have a forked repo in which we are creating new files - presently should not need to do merge's with upstream.
We did however unintentionally commit/push a common file to our repo:
pom.xml
Now the problem is that every time that we want to rebase to upstream via:
git rebase upstream/master
We then have merge conflicts with the pom.xml.
Our intention is to just completely forget/ignore any of our own repo changes to that file - and just use the latest upstream version . We do not want to have to deal with backing out our changes to that file every time we sync to upstream.
Now, simply doing
git checkout HEAD -- pom.xml
will not work since that pulls the latest version from our local repo.
Also using
git rebase -i upstream/master
is not clear how would help - since the commit in which pom.xml was included has other changes we do need. We can not simply remove that particular commit
So what are the options here for - as much as possible - completely forgetting our changes to pom.xml. If the git history were not possible to fix, at least we want to avoid needing to do repeated merges of that file every time a merge to upstream is performed.