bitbucket - In Git when pushing the master branch, commits from the development branch are pushed too. Is this supposed to happen? I am using Gitflow -
when started working git based workflow on gitflow model: http://nvie.com/posts/a-successful-git-branching-model/. thought main idea keep commits appropriate branches; example main branch have commits had been merged in development branch ... ie tags ... 0.1. 0.2. 1.0 in graphic. don't understand how git works or how workflow meant operate that's thought, since graphic on page shows these few commits on master branch, not development ones well.
i push repo bitbucket , went while working in development branch, when finished development; , and pushed master branch found master branch in bitbucket contains of commits made on development branch, whereas thought contain last commit ( 1 merged in). can explain why this, , whether intended behaviour, , if not can workflow working in line model above. use smartgit.
your branching model seems require specifying --no-ff
on every merge, forcing bookkeeping entries empty merges -- example in graphic you'd merge hotfixes 0.2, gets 1 commit onto master branch , doesn't merging, git merge --no-ff hotfixes
. on projects un-git-aware administrative requirements that's way it. vonc answered case skipped model's --no-ff
requirement somewhere.
for case did follow model , weren't expecting push
behave does: if checkout master of 1.0 in repo graphic's history , push remote's master branch, when push completes remote have commits m2,m4,m5,y1-6,g1-4,r1, , c1-3 (labeling commits according color , vertical sequence), , remote master branch refer of that.
the thing understand commit histories important, ref names not, @ least not "capital-i" important. git push
updates remote refs using local refs, while sending objects necessary complete given refs.
usually, if repo part of project's primary development you're tracking "central" repo's ref names. git's default clone sets local remotes/origin/* branches those; other setups aren't @ unusual — if you've got repo you're working on v2.1 of project, might regard other repo's release-v2.1 branch repo's 'master' branch.
if want push results of commit, without pushing history, have make new commit has results doesn't have history. other dvcs's have been built people regard constructing histories way varying degrees of repugnance; git sees choices none of business: provides (it is) tools implement model care imagine. git cherry-pick
make new commit diffing named commit against first parent , applying diff current head, cherry-picked commit's message. vanilla git rebase
picks entire sequence of commits that. behavior think expecting git merge --squash; git commit
does: apply diffs in commit's history , forget came from. if that, no commit anywhere else ever appear on branch's history. that's not model graphic trying convey.
Comments
Post a Comment