i awoke morning , looked @ commit history of 1 of dev team's private repositories on bitbucket. saw this:
anonymous committed fcde879
mergemerge branch 'develop' of https://bitbucket.org/abc/xyz develop
this is, uh, unusual. guess pushed new machine didn't have git configured properly. still, not sure why doing this. on bitbucket, shows 2 separate hashes commit parents, not have "view raw commit" option of other commits.
i checked out branch, pulled, , looked @ log manually.
sidious@ds-1:/path/to/repo$ git log -1 --format=raw tree 2931d14f48e61eaf0bbe0660af5b5dd76c07f063 parent 6bb38dee681df7620ffa42b6790641a7873166f2 parent f59c82e19e3e79310a53e273bab78139c49ff063 author root <root@somemachine> 1437069530 +0000 committer root <root@somemachine> 1437069530 +0000 merge branch 'develop' of https://bitbucket.org/abc/xyz develop as far can tell, 6bb parent on develop branch , f59 parent appears different branch. kinda hard tell going on.
i searched not find answer, , need grind, posit query here: why git merging branch itself? or, rather, why nomenclature being used commit message?
this scenario not unusual.
the key here branches being merged different: it's remote repository's develop branch being merged developer's local (working) develop branch.
in developer's local repository there 2 distinct branches:
develop= branch works on. commits go here.origin/develop= snapshot current repository holds state ofdevelopbranch on remote server. gets updated remote changes whenfetchorpull, , local changes after successfulpush.
now, when git pull, 2 things happen. because git pull alias other 2 git operations: fetch , merge:
fetch- brings new commits (if any) remote repository localorigin/developbranch.merge- takes new commits , applies them local workingdevelop branch. can happen in 1 of 2 ways:- if local working branch not contain divergent history (new commits remote not know about), advances
developbranch pointer ahead, points latest commit inorigin/develop. known fast-forward merge. - if developer has new commits of own not present in remote repo, and, therefore not in
origin/developbranch, regular merge done, meaning there's new commit, containing changes both branches. default, git assigns messages these such commits:merge branch 'develop' of https://bitbucket.org/abc/xyz develop.
- if local working branch not contain divergent history (new commits remote not know about), advances
so, scenario pretty common one.
now, if happens , don't see complex commit history graphs containing commits 1 we're talking about, try looking using rebase instead of merge.
you can 2 ways (when getting changes remote server):
git fetch; git rebasegit pull --rebase
Comments
Post a Comment