DEV Community

Takahiro Fukushima
Takahiro Fukushima

Posted on

2

Use git pull --rebase origin develop when you pull latest develop branch

git pull --rebase origin develop

What a useful command!
When you join develop team, you always use git.
But...
When you complete code and push it to remote repository, you look conflict message, so it slightly sad.

Then Whenever you use git pull --rebase origin develop.

Condition

Development team must follow Git-Flow.
It's branch strategy.

main branch
develop branch
feature branch
Enter fullscreen mode Exit fullscreen mode

When use it

First you create new feature branch.
Second you're coding.
Third you enter git pull --rebase origin develop, after Lunch.
So develop branch may have been updated.

It's also good when coding is done, you enter it.

If there is nothing else,

Successfully rebased and updated xxxx
Enter fullscreen mode Exit fullscreen mode

OK, No Conflict.
Let's push it.

But you catch conflict message, you fix code.

You enter blow command after you fix it.

git add fixed file
Enter fullscreen mode Exit fullscreen mode

You enter blow command.

git status
Enter fullscreen mode Exit fullscreen mode

If it's no conflict,

nothing to commit, working tree clean
Enter fullscreen mode Exit fullscreen mode

Ok, next you enter blow command, so you finish rebase.

git rebase --continue
Enter fullscreen mode Exit fullscreen mode

If It's no problem,

Successfully rebased and updated xxxxxx
Enter fullscreen mode Exit fullscreen mode

How about it?
It's easy way.
But you carefully research rebase and pull, so you use command.

Have a good engineer life.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️