I have a develop branch and a feature branch in my git repo. I added a commit to develop and now I want that commit to be merged to my feature branch. If I do this
git checkout feature
git merge develop
I end up with a merge commit. Since I'll be merging new commits on develop to my feature branch frequently, I'd like to avoid all these unnecessary merge commits. I saw this answer that suggested doing a git rebase develop
but it ends up rewinding my branch way too far and the rebase fails.
Update: What I ended up doing was
git checkout feature
git merge develop # this creates a merge commit that I don't want
git rebase # this gets rid of the merge commit but keeps the commits from develop that I do want
git push
Update: I just noticed that the original commit on develop gets a different hash when I merge then rebase to the feature branch. I don't think that's what I want because eventually I'll merge feature back into develop and I'm guessing this won't play nice.