4
I’m starting to study and use DVCS (versioning programs: GIT, Mercurial).
I tried to reassemble a folder structure using branches but the result was not as expected. I wanted to understand how the structure works.
What I did was this:
I opened a rep on the gitbucket:
xyp
You have the master branch, and I created 5 branches: B1, B2, 3b, B4 and B5
I downloaded it to my machine in a briefcase, made a clone, pasted a folder [B1] inside that folder, finished the branch with the same branch:
git checkout -b b1
Afterward:
git add *
To add new files to such branch, and then commit:
git commit -m "1 commit b1"
Then I pushed:
git push https://*******@bitbucket.org/*****/******.git
And I did so in the 5 cases imagining that there would be following structure in the branches as the folders:
masters
b1 b2 b3 b4
Only when I looked at the branches in the gitbucket, the structure was all bent:
- 1 commit B1 got 5 branches inside [B1 B2 B3 B4 B5]
- the 2 commit B2 got 4 branches inside [B2 B3 B4 B5]
- the 3 commit B3 got 3 branches in [ B3 B4 B5]
And so on and so forth. And the last stayed with one, only with himself
commit b5 (b5)
Because this strange structure didn’t agree with what I thought and structured?
If you want each branch to leave the
master, before creating a new check where it is, as it will be created from where it, if you create from themaster, would have to synchronize the master and then create the branch.– David
Entering the graphical mode in the branches tab gitbuckt and listing they appear this structure, isos that I found strange 1 commit B5 1 Branches inside them appears [B5] 1 commit B4 2 branches inside them appears [B4 B5] 1 commit B3 branches inside them appears [B3 B4 B5] 1 commit B2 4 branches inside them appears [B2 B3 B4 B5] 1 commit B1 5 branches inside them appears [B1 B2 B3 B4 B5] what I expected was how I idealized 1 commit B5 1 Branches [B5] 1 branches 1 commit B4 1 [B4] 1 commit B3 1 branches [B3] 1 commit B2 1 branches [B2] 1 commit B1 1 branches [B1]
– hyperpixel