Let's say I have development branch and FixBullshit branch and I have 5 commits in FixBullshit, I do a pull request but merge development with FixBullshit with merge + squash to keep it in development as 1 commit to keep it clearer (is it the best option, by the way?)
The thing is, after doing that, in the network graph of github it looks like Bullshit branch went out of development, but it never merged and then there appears 1 commit in development but there's not relation to Bullshit branch, like it happens in my git https://github.com/noxerr/VRHarry/network with branches development and "fixSensorsinput"
what am I doing wrong? how could I create that link on the network?
The network graph shows the history of the git repo, and "squashing" alters history by compressing it.
What Github is doing is taking this graph
A--B--C--D--E
\
F--G--H
squashing F--G--H
into a single commit W
, and applying it as
A--B--C--D--E--W
\
F--G--H
To do what you are suggesting, you could squash F--G--H
together into a commit Q
before merging to make a graph like
A--B--C--D--E--I
\ /
Q--------
Unfortunately, this form of squash merging alters history, which can cause problems for those with a local copy of the old history. This is probably why Github squash merges as described above, instead of like this.
There are many pages on the internet like this one about the advantages and disadvantages of squashing, rebasing, and other merge methods.
If you do it then you will lose the track of the branches because this is the way git works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With