Git: Pulling a rebased branch

If Mr. Orange doesn’t mind losing his changes, he can fetch from the server, then checkout the the branch:

git checkout A to get onto his local A branch.

Then, assuming the remote is named “origin”, reset your local branch in favor of the remote branch:

git reset --hard origin/A

If he is concerned with losing changes, he can merge the server’s changes in to resolve them (from his own A branch, and presuming again that the remote is named “origin”) with git merge origin/A. This will make a new commit that’s on top of both his and the remote’s A branches with the changes from both merged together. Then this can be pushed back to the remote.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)