适合自己的Git工作流

总结的提交流程---使用merger
$ git checkout -b featureB origin/master
# (change implementation)
$ git commit
# (origin/master changed)
$ git push myfork featureB
# (failed)

$ git checkout -b featureBv2 origin/master
$ git merge --no-ff --squash featureB 				# 或者使用git merge --no-ff --no-commit featureB
$ git mergetool 
# (change implementation)
$ git commit
$ git push myfork featureBv2


============
merge参数解释
--ff(默认的选项)

    When the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. This is the default behavior.
--no-ff

    Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag.


--no-squash(默认的选项)
--squash
	With --no-squash perform the merge and commit the result. This option can be used to override --squash.

    Produce the working tree and index state as if a real merge happened (except for the merge information), 
but do not actually make a commit, move the HEAD, or record $GIT_DIR/MERGE_HEAD (to cause the next git commit command to create a merge commit). 
This allows you to create a single commit on top of the current branch whose effect is the same as merging another branch (or more in case of an octopus).
	
	
--commit(默认的选项)
--no-commit

    Perform the merge and commit the result. This option can be used to override --no-commit.

    With --no-commit perform the merge but pretend the merge failed and do not autocommit, 
to give the user a chance to inspect and further tweak the merge result before committing.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值