Note that there are some explanatory texts on larger screens.

plurals
  1. POgit rebase on long-lived (remote) feature branches
    primarykey
    data
    text
    <p><strong>Background:</strong> We use github for our project and I work on my own fork of our main repository. We use rebase instead of merge to avoid large merge commits. </p> <p><strong>Scenario:</strong> The way I want to work is like this:</p> <ol> <li>When implementing a new feature, create a local branch of my fork's master and put in my changes there. I and others in the group make many small commits, so there will almost always be multiple commits that affect the same file on the branch.</li> <li>Push the local branch to my fork so I have a remote copy of what I am working on (I don't want to have all my changes lost if my laptop dies or is lost. I try to do this at the end of each day).</li> <li>If it takes a long time to finish the feature, I occasionally rebase on my fork's master to make sure that there has been no changes that could break my feature. This usually works ok.</li> <li>To keep the remote copy of the branch up to date, I push my local branch to that after the rebase. </li> </ol> <p><strong>Problem:</strong> Step 4 is where I get the problems. I almost always have to deal with non-fast-forwarded commits and use git push --force. </p> <p>I've looked at </p> <p><a href="https://stackoverflow.com/questions/2170179/git-how-to-maintain-permanent-parallel-branches">Git: how to maintain permanent parallel branches</a></p> <p><a href="https://stackoverflow.com/questions/2152841/git-how-maintain-mostly-parallel-branches-with-only-a-few-difference">How to maintain (mostly) parallel branches with only a few difference</a></p> <p>and haven't found a way to make my workflow work. Doing a google search on git workflows mostly returns results that assume that you all work on local branches and don't keep a remote copy on github (e.g. <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="nofollow noreferrer">http://nvie.com/posts/a-successful-git-branching-model/</a>).</p> <p>I'm relatively new to Git, so I'd like to know if I am missing something here. I'd like to be able to do step 4 without a --force. An alternate workflow that still allows me to use rebase instead of merge and keep a remote copy of my local branch would also be very useful.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload