大家好我是git的新手,我正在开发一个项目,我需要尊重这个图表我只是想知道我该怎么做才能获得这个git图表的命令和说明请
我只知道每个顶点都是一个提交,所有标签都是分支名称 我不知道从哪里开始,我需要在之前创建所有分支或者根本不清楚
答案 0 :(得分:3)
git init # initialize a git repo
git commit --allow-empty -m foo # create a commit with message "foo"
git checkout -b feature1 # create and check out a branch named "feature1" from the current commit
git commit --allow-empty -m bar # create a commit with message "bar"
git checkout -b feature2 # create and check out a branch named "feature2" from the current commit
git commit --allow-empty -m baz # create a commit with message "baz"
git checkout -b feature3 # create and check out a branch named "feature3" from the current commit
git commit --allow-empty -m qux # create a commit with message "qux"
git checkout master # check out branch "master"
git commit --allow-empty -m toto # create a commit with message "toto"
git merge -m 'merge feature 1' feature1 # merge feature1 with message "merge feature 1"
git merge -m 'merge feature 2' feature2 # merge feature2 with message "merge feature 2"
git merge -m 'merge feature 3' feature3 # merge feature3 with message "merge feature 3"