Rebase/merge against another branch overriding conflicts with your own branch
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 17
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Quite often I find myself in a situation when I need to rebase my local feature branch containing the latest code against the master, but running git rebase master generates a bunch of conflicts that I am expected to fix manually, though I know that my local feature branch has the latest and greatest and I simply want the changes in my feature branch overwrite the corresponding files in master each time such conflict arises. This usually happens when I am the only committer on the project.
Changes in my-branch overwrite changes in master
If rebasing:
git checkout my-branch
git rebase -Xtheirs upstream/master
If merging (the meaning of -Xtheirs and -Xours is reversed):
git checkout my-branch
git merge -Xours upstream/master
Changes in master overwrite changes in my-branch
Do the opposite, i.e. where it says -Xtheirs do -Xours and visaversa.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked source and the issue's Git rebase and merge examples. Check the repository's existing resource organization to determine where this material belongs; done means the guidance is incorporated in the appropriate resource location without changing the documented commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100