![]() hint: See the 'Note about fast-forwards' in 'git push -help' for details. First let's consider the opposite of what you asked: What if we rebase FB onto master?Every commit in FB is already in master, so it will place 0 commits on top of master. First fetch all remote branches: git fetch. to keep the repository clean, your commits always on top of the tree until you push them to a remote server. When you rewrite the history of a remote branch, the -force is necessary (and you understand the consequences). if you want to rebase to remote master, use origin/master where origin is remote name, and origin/master is your local snapshot from remote, you should check that it is synced with remote before you do rebase by using git pull/fetch, no need to check out to master and then check back to featureX … If you want origin/fix branch is based on the top of upstream/master branch, you should do: git checkout fix git pull upstream master -rebase. This works and reverts the changes on my local branch but then I don't know what to make the remote branch update to that since it doesn't create a new commit that can be pushed to the remote. Master- \ Branch1-commit1-commit2 \ Branch2 … Remote Branches. Other developers then know they'll need to rebase their devel branches off my latest: git fetch git checkout devel1 git rebase /devel0. git checkout B git rebase master git checkout B~ # this is the commit before B (the A commit) git branch -d A # remove the old A branch (it was rebased, and so is now invalid git branch A # recreate … There are two ways to fix the things: Move the branch dev on the current commit. merge options will be used (see git-config for details) and the -fork-point option is assumed. ![]() Then switch to your (local) master and do a normal rebase onto that branch. Your two options would be a traditional merge-commit, or a squash … Given a git repo with two branches master and feature. ![]() If you want, you can keep many backups around, by pushing to new feature branches without rewriting or deleting old ones. ![]()
4 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |