It comes down to whether the feature is used by one person or if others are working off of it.
You can force the push after the rebase if it’s just you:
git push origin feature -f
However, if others are working on it, you should merge and not rebase off of master.
git merge master git push origin feature
This will ensure that you have a common history with the people you are collaborating with.
On a different level, you should not be doing back-merges. What you are doing is polluting your feature branch’s history with other commits that don’t belong to the feature, making subsequent work with that branch more difficult – rebasing or not.
This is my article on the subject called branch per feature.
Hope this helps.
Related Posts:
- How can I delete all Git branches which have been merged?
- How do I discard unstaged changes in Git?
- Git: How do I force “git pull” to overwrite local files?
- How can I make git accept a self signed certificate?
- How can I revert multiple Git commits (already pushed) to a published repository?
- What is the difference between ‘git pull’ and ‘git fetch’?
- Git: cannot do a partial commit during a merge (SourceTree)
- Git: How do I force “git pull” to overwrite local files?
- What is the meaning of git reset –hard origin/master?
- Why does ‘git commit’ not save my changes?
- How can I undo git reset –hard HEAD~1?
- Set up git to pull and push all branches
- git push to specific branch
- Get changes from master into branch in Git
- how to reset develop branch to master
- What is the Git equivalent for revision number?
- difference between git merge origin/master and git pull
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- How do I rename a local Git branch?
- How do I undo the most recent local commits in Git?
- Git: How do I force “git pull” to overwrite local files?
- Differences between git pull origin master & git pull origin/master
- How do I rename a local Git branch?
- How can I switch to another branch in git?
- How to remove local (untracked) files from the current Git working tree
- Squash my last X commits together using Git
- Git merge hotfix branch into feature branch
- Git refusing to merge unrelated histories on rebase
- Git fetch remote branch
- How do I discard unstaged changes in Git?
- Git fetch remote branch
- How do I list all remote branches in Git 1.7+?
- Download single files from GitHub
- Undoing a git rebase
- Undoing a git rebase
- How to fetch all Git branches
- How to fetch all Git branches
- Git: How to squash all commits on branch
- Undo git pull, how to bring repos to old state
- Why do I have to “git push –set-upstream origin
“? - How to get the current branch name in Git?
- How do you create a remote Git branch?
- How to pull a specific branch from Github
- Make an existing Git branch track a remote branch?
- What does “Git push non-fast-forward updates were rejected” mean?
- Undo git pull, how to bring repos to old state
- Why do I have to “git push –set-upstream origin
“? - How to get the current branch name in Git?
- How do you create a remote Git branch?
- How can I reset or revert a file to a specific revision?
- Else clause on Python while statement
- master branch and ‘origin/master’ have diverged, how to ‘undiverge’ branches’?
- Branch from a previous commit using Git
- git pull from master into the development branch
- What does ‘git remote add upstream’ help achieve?
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - Delete all local git branches
- How can I copy the content of a branch to a new local branch?
- Git: Merge a Remote branch locally
- How to squash all git commits into one?
- Invalid VCS root mapping – 3 errors on my project
- Updates were rejected because the remote contains work that you do not have locally
- How do I clone a single branch in Git?
- Do I commit the package-lock.json file created by npm 5?
- How can I see the changes in a Git commit?
- How do I run git log to see changes only for a specific branch?
- What’s a good (free) visual merge tool for Git? (on windows)
- Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files? [closed]
- Should I use SVN or Git?
- WordPress Health Tool reporting version control as a critical issue
- storing database in version control
- Is it better to create a Git repository at the root level or in the WordPress theme directory?
- Pull latest stable release via git [closed]
- How should I be handling my theme version numbering?
- Version control with a team of non-developers
- Painless way to track remote Git repo for WordPress updates
- Questions about Git and WordPress [duplicate]
- How to rename the wp-config.php file once under version control?
- How to use one git (github) repository for version control for multiple themes
- version control for wordpress? (wordpress folder and database at same time)
- Revision History for Entire WordPress Site
- WordPress and Git: How does Git interact with your IDE? [closed]
- Windows git “warning: LF will be replaced by CRLF”, is that warning tail backward?
- Untrack files from git temporarily
- How to copy commits from one branch to another?
- What’s the difference between git switch and git checkout
- gpg failed to sign the data fatal: failed to write commit object
- How to resolve git’s “not something we can merge” error
- Git nothing added to commit but untracked files present – even with those files added to gitignore
- Repository is not clean. Please commit or stash any changes before updating In Angular 8
- Bower: ENOGIT Git is not installed or not in the PATH
- git add only modified changes and ignore untracked files
- How can I generate a Git patch for a specific commit?
- Unlink of file Failed. Should I try again?
- How can I sync WordPress plugin settings between environments?
- Workflow for working with git and WordPress
- How to make my plugin able to be updated from admin panel?
- Automatic updates and merging manual changes
- Can plugin2 uninstall plugin1 at the very beginning of plugin2’s installation?