I'm working on a project. Ok. And in this project on the master branch I decided to change it to sketch, which is where all the phases/beta versions of the project are. So a few days ago I had to create other branches to store other things I didn't want to change. With that done, ok I guess. But yesterday I saw that it was time to create a branch for the final version, so just now I've created a main branch, and with that, it was created but it wasn't the default, so I made it the default (on GitHub). After that, ok, all right, but I started having some serious problems. I managed to fix this but now on GitHub it's showing that the default branch is below a branch, as you can see here:
The main branch (default) is below the sketch. Can this cause some problem, or conflict? Another thing: I'm getting a message on my Git Bash:
$ git status
On branch main
Your branch and 'origin/sketch' have diverged,
and have 3 and 2 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
I think it might be some position ahead that might or might not be causing it. Sorry for the long text, I just want you to understand this story well.
So the question is: can this default branch below the other cause any problems? I don't think this issue of diverging branches has anything to do with this, or does? If so, how can I set it to above all?
P.S.: Something funny I've noted now. When I look at my branches in Bash I have this:
$ git branch
* main
sketch
sketch-1
sketch-2
sketch-3
sketch-4
????
CodePudding user response:
Branches don't have an "order" as far as git is concerned, they're like files in a directory, and can be sorted however you like (in fact internally they are files in a directory).
I've no idea why Github has picked the order it has, rather than alphabetical order, or putting the default branch first. Maybe it's showing the branch with the most recent commits first. It won't make any difference to anything, though.