There's no "risk" involved in pulling changes from origin/develop
directly into your local feature branch without first updating your local develop
branch. However, there are a couple things you should keep in mind:
- Do a pull rebase instead of a regular merge
- When you compare your local feature branch with your local
develop
branch, the former is going to contain commits that you didn't make, but that instead came from origin/develop
Here's an example that illustrates this scenario:
o---o develop
\
A---B---C feature
o---o---D---E origin/develop
Once you pull in the commits from origin/develop
directly into feature
, either from the IDE (make sure you enable the rebase option) or with git pull -r origin develop
, the branch is going to look like this:
o---o develop
\
D---E---A'---B'---C' feature
o---o---D---E origin/develop
Now, if you compare feature
with the local develop
, it's going to look like commits D
and E
were created in the feature
branch, while, in reality, they came from origin/develop
.
Of course, once you sync your local develop
with origin/develop
, everything is going to look like you expect:
o---o---D---E develop
\
A'---B'---C' feature
o---o---D---E origin/develop
I wrote a blog post that explains why the default git pull
with a shared branch leads to a more complicated history.