【发布时间】:2012-03-03 11:38:14
【问题描述】:
假设我在master 分支并创建了一个新分支:
git checkout -b feature_branch
我开始在 feature_branch 上工作,并且在某个时候我想使用 rebase 将我的更改合并到 master。所以,我愿意:
# Get the latest code on master
git checkout master
git pull
# Rebase on master and push the most updated 'feature_branch'
git checkout feature_branch
git rebase master
git push
# Merge 'feature_branch' to 'master' and push the updated 'master'
git checkout master
git merge feature_branch
git push
# Back to work on 'feature_branch'
git checkout feature_branch
有没有办法减少步骤并达到同样的效果?
在流程结束时,我希望 master、origin/master、feature_branch 和 origin/feature_branch 指向同一个提交。
【问题讨论】:
标签: git git-rebase git-merge git-push