HamletHub HamletHub - 11 days ago 4x
Git Question

How can I force git to merge changes from branch to master that are "unchanged"

I would like to force git to overwrite files in master from a branch, that it does not believe are changed.

Master Branch has file configA
Create branch from Master called BranchA which has file configA
Create Dev branch from Master called dev.
Make changes on dev, including changes to file configA
Merge changes from dev to master

Now I would like to overwrite the changes to configA on Master with file configA on BranchA (original file)
It will not merge configA back to the master, because it does not see configA on BranchA as a changed file.

I have used rm --cache to force git to "readd" the file configA to a commit on branchA, but it still ignores it.

Is there any command to force git to merge files from a branch, even if it does not believe they have been changed?



Just get its content and commit it?

git checkout Master
git checkout BranchA -- configA
git commit -m "whatever"