开发者

Git production and master not the same

I usually work on my Master branch, and push to Production. I accidentally worked on Production branched and deployed the app. Now my Production has the latest version, Master has older version.

What should I do to update the Master bra开发者_Go百科nch files to the same as Production? What commands to issue?

I will be careful and work only on Master branch in future. Thanks.


Make your current branch master and run

git merge production

or

git rebase production

See merge vs rebase for differences.


If it hasn't been pulled to a remote or the remote can be overwritten, I would cherry-pick the new commits from production to master, delete the commits from production (via interactive rebase) and then do the usual rebase-merge cycle for updating production branch from master.

Check progit.org for each steps exact syntax and be careful, git is very powerful, so you can fix any screw up, but you can also screw it pretty bad.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜