Routinely sync a branch to master using git rebase

Posted by m1755 on Stack Overflow See other posts from Stack Overflow or by m1755
Published on 2010-05-13T05:43:32Z Indexed on 2010/05/13 10:14 UTC
Read the original article Hit count: 321

Filed under:
|
|

I have a Git repository with a branch that hardly ever changes (nobody else is contributing to it). It is basically the master branch with some code and files stripped out. Having this branch around makes it easy for me to package up a leaner version of my project without having to strip out the code and files manually every time.

I have been using git rebase to keep this branch up to date with the master but I always get this warning when I try to push the branch after rebasing:

To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

I then use git push --force and it works but I feel like this is probably bad practice. I want to keep this branch "in sync" with the master quickly and easily. Is there a better way of handling this task?

© Stack Overflow or respective owner

Related posts about git

Related posts about git-rebase