Search code examples
gitgithubbranchgit-merge

How to update my working Git branch from another branch (develop)?


I made a new branch called feature1 from the main develop branch a month ago.

⇒  git branch 
  develop
* feature1

I've been working on feature1 for a month now and a lot of changes have been pushed to develop.

How can I update my current branch feature1 with the latest commits from develop?

I DO NOT want to checkout master and merge my feature1 branch into it. Neither do I want to use git cherry-pick to manually move commits from develop to feature1.

How would I go about doing this?


Solution

  • You just merge develop to feature1:

    git checkout feature1
    git merge develop
    

    There is no need to involve another branch such as master.