hi I have a develop branch based on master branch. I make changes in the develop branch. Now, my question is if the master branch is to be updated, how can I upgrade the develop branch based on the master branch Without losing my changes in develop branch?
Depends on what you mean "upgrade", but I would assume you want your develop branch to have the commits master has.
So you need a git merge
or a git rebase
.
# merge master into develop
git checkout develop
git merge master
or
# rebase develop on top of master
git checkout develop
git rebase master
Or if your master is on a server and you want to get the changes from your origin, you can have to do the same things, but with the pull
command.
git checkout develop
git pull #or git pull --rebase
Note that your current working directory must be clean. Otherwise you must commit (or stash) your changes, in order to get things from master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With