git将一个分支的内容替换为另一分支内容

假设我想将我的linux分支内容替换master分支的内容。

# 切换到master分支
git checkout master
# 再将本地的master分支重置成linux
git reset --hard linux  
# 最后推送到远程仓库master分支
git push origin master --force 

转载自“leo108”的回答,http://www.oschina.net/question/1993919_224813

猜你喜欢

转载自blog.csdn.net/goldlone/article/details/81124993