简体   繁体   中英

Rebasing a local branch from develop

I want to rebase a feature branch from develop. I am using PhpStorm Git integration and I have 2 different develop branches:

refs/remotes/origin/develop
refs/heads/develop

In order to do not mess up things, which one do I have to choose to rebase?

I don't know the phpstorm interface for Git, but in the command line I'd do the following:

  • git checkout develop
  • git pull origin develop -> this fetches the remote version of the develop branch and merges it (or rebases it, depending on your pull strategy) into/onto your local branch. This way the local and the remote versions of develop are the same
  • git checkout feature-brach
  • git rebase develop

If there are any conflicts - resolve them. After that you can create a pull request against develop .

When you are at your branch, where you have committed changes: Do the following:

  1. git fetch
  2. git rebase origin/develop In case of any conflicts, please fix them. Then,
  3. git add .
  4. git rebase --continue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM