Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I made a new branch for my code like a month ago, I created feature1 branch from develop branch.

⇒  git branch    develop * feature1 

I've been working on feature1 for a month now and a lot of the changes pushed to develop branch, How can I update my current branch feature1 with the latest commits at develop one?

I don't want to checkout master and merge my feature1 branch. Neither I want to use git cherry-pick to manually move commits from develop to feature1.

Any help ?

like image 291
Eki Eqbal Avatar asked Oct 01 '14 09:10

Eki Eqbal


People also ask

How do I update my remote branch?

Forces an update of the remote branch after rewriting the history locally. Use git push -f to force update the remote branch, overwriting it using the local branch's changes. This operation is necessary anytime your local and remote repository diverge.


1 Answers

You just merge develop to feature1:

git checkout feature1 git merge develop 

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

like image 53
musiKk Avatar answered Sep 22 '22 20:09

musiKk