In general, you can use the --strategy option to specify how conflicts should be handled. The strategy theirs blindly replaces files.

However, in your case, you've only got a single file. You really won't want to use the theirs strategy for all files. Instead, after you get the message to resolve the conflict, you can checkout that one specific file from the branch:

git checkout <branch> yourfile

(At that point, <branch> still refers to the branch as it was before the rebase started.)

Answer from user743382 on Stack Overflow
🌐
Git
git-scm.com › book › en › v2 › Git-Branching-Rebasing
Git - Rebasing
Next, the person who pushed the merged work decides to go back and rebase their work instead; they do a git push --force to overwrite the history on the server.
Discussions

Newbie - does git pull --rebase branch overwrite changes without warnings?
It shouldn't; you should get a conflict when you do the rebase, get asked to resolve the conflict, then continue the rebase More on reddit.com
🌐 r/git
4
3
December 9, 2021
Why git rebase overwrite my local changes? How to avoid overwrite? - Stack Overflow
I'm trying to rebase my branch with the master. But it is always overwrite my local changes after rebase. I'm using the command git rebase and it will show one file conflict, then I manually reso... More on stackoverflow.com
🌐 stackoverflow.com
git svn - Git rebase - force overwrite on merge conflict - Stack Overflow
I am trying to do a git rebase to migrate data to a disconnected SVN clone branch. Let's say I am trying this with the SoundManager2 repo from Github. About the first 20 or so of the rebase acti... More on stackoverflow.com
🌐 stackoverflow.com
version control - How do I force "git pull" to overwrite local files? - Stack Overflow
It seems like most answers here ... I want a rebase in one to be reflected in the other without a lot of jumping through hoops. Based on a combination of RNA's answer and torek's answer to a similar question, I've come up with this which works splendidly: ... Run this from a branch and it'll only reset your local branch to the upstream version. This can be nicely put into a git alias (git forcepull) as ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Demisx
demisx.github.io › git › rebase › 2015 › 07 › 02 › git-rebase-keep-my-branch-changes.html
How to rebase against another branch overriding conflicts with your own branch changes
July 2, 2015 - # rebase preferring current branch changes merge during conflicts $ git rebase -Xtheirs branch-b · -Xtheirs will favor your current branch-a code when overwriting merge conflicts, and vice versa -Xours will overwrite merge conflicts with with the code in branch-b.
🌐
Graphite
graphite.com › guides › git-rebase-force
Force pushing after a Git rebase - Graphite
In order to complete the rebase, you must rewrite the history of the remote repository using git push --force. This will overwrite the history of the remote branch with the edited rebased history of the local branch.
🌐
Reddit
reddit.com › r/git › newbie - does git pull --rebase branch overwrite changes without warnings?
r/git on Reddit: Newbie - does git pull --rebase branch overwrite changes without warnings?
December 9, 2021 -

Say 2 people are working at the same branch name development.

If person A changes file A -line 1> commit and pusehd

person B changes file A line 1 -> commit -> git pull --rebase origin development.

Will the git pull --rebase overwrite person A's changes without warnings? I am on mobile right now & can't test but my curiosity is itching !

Top answer
1 of 5
1

It sounds like your working directory was dirty at the time you did your rebase. You should probably be prepared for your working directory and stage to be wiped when you do a rebase. As a workaround, if you find yourself with a non empty working directory and/or stage, but you need to rebase to the latest other branch, you could do a stash, i.e.

git stash

Git will make 2 (or even 3) commits to preserve your working directory and stage as they currently are. After the rebase is complete, you can get these changes back by applying the stash:

git stash apply

I think in some cases Git would not even allow you to do a merge or rebase depending on the state of your working directory and stage. But in any case, it might be a good idea to make sure they are clean before rebasing.

2 of 5
1

Without much information about your current state, it's possible that some of your local commits might already be part of the branch you're rebasing onto.

For example, let's say you're trying to rebase develop on top of master. The develop branch contains a number of commits, but you've merged develop into master a few commits back.

In this case, git rebase master may appear to lose some of the commits, but git has detected they're already part of master so they don't need to be reapplied.

You can use git rebase --interactive to be presented with the list of commits that are about to be rebased. If you don't see some commits you expected, or you see more commits than you expected, you might need to look at using --onto to change the starting point for the rebased commits.

🌐
Stack Overflow
stackoverflow.com › questions › 5944335 › git-rebase-force-overwrite-on-merge-conflict
git svn - Git rebase - force overwrite on merge conflict - Stack Overflow
Something like git rebase -X theirs... ... You will always get this issue. Git can't assume anything when there's a conflict. Sounds like you want your changes to be on top of whatever is published to the svn repo.
Find elsewhere
🌐
Squash
squash.io › how-to-force-overwrite-during-git-merge
How to Force Overwrite During Git Merge - Squash Labs
October 28, 2023 - Related Article: How To Handle Git Refusing To Merge Unrelated Histories On Rebase · Another way to force overwrite during a git merge is by using the git reset and git checkout commands.
🌐
Gerald Versluis Blog
blog.verslu.is › gerald versluis — . net maui, git hub copilot & ai powered development › blog posts — . net maui, git hub copilot & ai development › git › git rebase don't be afraid of the force ( push)
Git Rebase: Don't be Afraid of the Force (Push) - Gerald Versluis
January 7, 2020 - This has all the latest bits from our target branch and includes all of our changes. To get it all back into sync, we need to do a force push. With a force push we simply push all our local changes and overwrite whatever is on the remote branch.
🌐
FlatCoding
flatcoding.com › home › git pull force: safely overwrite local changes
Git Pull Force: Safely Overwrite Local Changes - FlatCoding
March 30, 2025 - There’s also another way using --rebase. Let’s move on to the next section to learn it. While Git has no --force option for pull, doing a git pull --rebase will give you a similar result, reapplying your local changes on top of the latest updates from the remote.
🌐
Quora
quora.com › How-do-I-force-git-pull-to-overwrite-local-files-1
How to force 'git pull' to overwrite local files - Quora
Answer (1 of 17): You can probably do [code]git stash git stash drop # deletes the latest changes on the stash [/code]However [code ]git reset HEAD —hard[/code] would be the proper way to do what you want. This resets your git workspace to the latest commit on the local branch, and discards ...
🌐
Delft Stack
delftstack.com › home › howto › git › git merge with force overwrite
How to Merge With Force Overwrite in Git | Delft Stack
February 2, 2024 - This tutorial demonstrates how to merge in Git with force overwrite using various commands.
🌐
GitLab
docs.gitlab.com › topics › git › git_rebase
Rebase and resolve merge conflicts | GitLab Docs
Complex Git operations like squashing commits, resetting a branch, or rebasing rewrite branch history. Git requires a forced update for these changes.
🌐
Codemia
codemia.io › knowledge-hub › path › how-do-i-force-git-pull-to-overwrite-local-files
How do I force "git pull" to overwrite local files?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Git
git-scm.com › docs › git-rebase
Git - git-rebase Documentation
Rebasing (or any other form of rewriting) a branch that others have based work on is a bad idea: anyone downstream of it is forced to manually fix their history. This section explains how to do the fix from the downstream’s point of view.
🌐
Git Tower
git-tower.com › learn › git faq › how do i force git pull to overwrite local files?
How do I force git pull to overwrite local files? | Learn Version Control with Git
5 days ago - No, git pull does not overwrite local changes. Git will abort the pull and show an error if your uncommitted changes conflict with incoming changes. This is a safety mechanism — your local work remains untouched until you explicitly decide ...
🌐
Graphite
staging-graphite-splash.vercel.app › guides › git-rebase-force
Force pushing after a Git rebase
In order to complete the rebase, you must rewrite the history of the remote repository using git push --force. This will overwrite the history of the remote branch with the edited rebased history of the local branch.
🌐
Squash
squash.io › how-to-force-git-pull-to-overwrite-local-files
How to Force Git Pull to Overwrite Local Files - Squash Labs
August 20, 2023 - Learn how to use git pull force to overwrite local files in Git. Avoid merge conflicts and update your local repository effortlessly with this step-by-step guide.