问题
I am still pretty noob in Git but probably after reading articles after articles, I seem to have raise doubt in my understanding and I am not sure if I am understanding it right...
Anyway I have 2 branches, Master and Develop (both created using git branch) As I created the Master branch first, followed by Develop, can I presume that this 2 branches are 2 standalone branches (see below) or is Develop under the Master?
Stand-Alone? Hierarchy? Master -- | Master Develop -- | \-- Develop
I was under the impression it should be standalone, until when I run git show-branch, it is displaying the results as (Notice the space in front of the [Master]):
[Develop] Creation of new Branch
[Master] Build of new Project
- If I am to create new (feature) branches, using Develop as my base,do I need to set it to the Develop branch first, otherwise can it be done from any branches?
Lastly is it possible to view the branches in the terminal in the following format:
Master Develop newBranch01 ...
回答1:
2 standalone branches (see below) or is Develop under the Master?
Neither.
Commits matter. Branch names don't. Focus on the commits. Branch and tag names are an afterthought, a trivial convenience. git log --graph --decorate --oneline --all and git show-branch will show you the history in two different representations, each has advantages.
来源:https://stackoverflow.com/questions/23466882/git-branch-hierarchy-issue