Git: How to keep the local function branch updated with the changes made to dev?

I am following this guide for working with git distributed projects: http://nvie.com/posts/a-successful-git-branching-model/ . It worked well, but now I run into a problem. I created a local function branch. I would like to update this branch with the latest changes made to dev . Is it possible? I studied this and found that I would probably need to use rebase . But there were so many options, I did not know exactly which one I needed to use. How can I do it?

+8
git branch
source share
2 answers

Periodically:

 λ git checkout dev λ git pull origin dev λ git checkout myfeaturebranch λ git merge dev 
+9
source share

Running git rebase dev while the function branches should do the trick (if necessary, first update the local dev from the origin).

This will re-change your changes from the function branch to dev, and then set the function title as the head of a new story.

Note: Only rebase if the commit of your function has not been pressed. He will rewrite your story. There are some caveats with rebase that may or may not be worth the risk.

+5
source share

All Articles