git快进一个提交

时间:2017-07-18 00:14:04

标签: git fast-forward

* 9dbd857 (hotfix-correct-java-jdk-path, feature/add-ansible-galaxy-requirements-file) requirements.yml: adds maven and nodejs requirements
* 1643619 (QOL-1640-enable-vpc-peering) roles/ansible-linux-commons: change value of hostname in cloud-init
* b5fd2a4 roles/bamboo-agent: add bitbucket ssh host key to /etc/ssh/ssh_known_hosts
* d5cc1f7 vpc cfn template: produce outputs conditionally
* 3b87efe vpc cfn template: use csv for subnet/AZ mapping
* 2e93096 roles/bamboo-agent: Install chrome on agents
* 9aeb07e roles/bamboo-agent: install chromium browser
* 89e852d (HEAD -> feature/QOL-1649-install-chrome) README: display the current directory structure of inventories
* 1f55c4b inventories/test: define root volume size
* 07d902e bamboo-ec2 cfn: specify root volume size

这是我(最近)的历史。

我希望feature/QOL-1649-install-chrome向上移动一次提交到9aeb07e

我尝试了樱桃选择,但随后我将该提交的“副本”复制到feature/QOL-1649-install-chrome分支上。但我想要的(我认为)是快进的。

2 个答案:

答案 0 :(得分:5)

你可以git reset,但为了一般安全和清洁,我更喜欢使用git merge --ff-only。要使用它,请查看您想要快进的分支(您已经),然后运行git merge --ff-only <commit-hash>

git merge --ff-only 9aeb07e

我经常使用此命令,因此我为它创建了一个别名git mff(快速合并)。

答案 1 :(得分:3)

git checkout feature/QOL-1649-install-chrome
git merge --ff-only 9aeb07e

git reset --hard 9aeb07e

而不是合并。

相关问题