[Git] git rebase (reduce merge commit)

In foss, we fork git project from upstream our account and clone to local.

We need to make sure that the respository is up-to-date, so sync to upstream is necessary.

But sometimes when we use git pull which is combined as git fetch and git merge, nonecessary merge occurs.

To avoid redundant merge commit, we  use git pull --rebase instead.

redfish[~] $ git pull --rebase upstream master
redfish[~] $ git push origin master <-f>

<-f> : force updated, that’s because you only rebase the local, but origin doesn’t not rebase.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s