git拆下分支机构中的头部&;合并
我在学习一些与git相关的主题和命令,这个场景发生在我结合使用git和GitHub功能,使用git拆下分支机构中的头部&;合并,git,github,git-branch,branching-and-merging,Git,Github,Git Branch,Branching And Merging,我在学习一些与git相关的主题和命令,这个场景发生在我结合使用git和GitHub功能,使用git push并在GitHub更改文件的同时,我创建了两个分支(jsfirst和imagegallery) 只是想了解出了什么问题,我正在努力分析,不打算在重要的项目上重复 编辑 为什么在图形视图中断开了564903c(imagegallery)Image gallery分支的连接 头{0},头{1},头{2},头{3}是什么意思 git log--all--decoration--oneline--g
git push
并在GitHub更改文件的同时,我创建了两个分支(jsfirst
和imagegallery
)
只是想了解出了什么问题,我正在努力分析,不打算在重要的项目上重复
编辑
为什么在图形视图中断开了564903c(imagegallery)Image gallery分支的连接
头{0},头{1},头{2},头{3}是什么意思
git log--all--decoration--oneline--graph的输出命令
* 76ebb92 (HEAD -> master) Merge branches 'master' and 'master' of https://github.com/sometest/test
|\
| * 4f264fe (origin/master) Created CONTRIBUTING.md
| * 1159fe3 Merge pull request #3 from sometest/code_of_conduct-patch-2
| |\
| | * a7184f0 (origin/code_of_conduct-patch-2) Updated code of conduct
| |/
| * 4369922 Merge pull request #2 from sometest/code_of_conduct-patch-1
| |\
| | * 1893331 (origin/code_of_conduct-patch-1) Created CODE_OF_CONDUCT.md
| |/
| * b3fbde0 Created .gitignore
| * 6275e91 Merge pull request #1 from sometest/add-license-1
| |\
| | * 38d02c5 (origin/add-license-1) Create LICENSE
| |/
* | cc0cdad (jsfirst) Silly story
* | a52170c Using events in JS
* | c271cdd Added number guessing game
* | 493a155 Learned basic of JS
|/
| * 564903c (imagegallery) Image gallery
|/
* 25266ce first commit
76ebb92 (HEAD -> master) HEAD@{0}: reset: moving to HEAD
76ebb92 (HEAD -> master) HEAD@{1}: checkout: moving from 564903c3078ffdbdbd43bceb3da3495daddf82da to master
564903c (imagegallery) HEAD@{2}: checkout: moving from master to 564903c
76ebb92 (HEAD -> master) HEAD@{3}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{4}: checkout: moving from master to imagegallery
76ebb92 (HEAD -> master) HEAD@{5}: pull: Merge made by the 'recursive' strategy.
cc0cdad (jsfirst) HEAD@{6}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{7}: checkout: moving from master to imagegallery
cc0cdad (jsfirst) HEAD@{8}: reset: moving to cc0cdad
25266ce HEAD@{9}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{10}: checkout: moving from master to imagegallery
25266ce HEAD@{11}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{12}: checkout: moving from master to imagegallery
25266ce HEAD@{13}: checkout: moving from jsfirst to master
cc0cdad (jsfirst) HEAD@{14}: checkout: moving from imagegallery to jsfirst
564903c (imagegallery) HEAD@{15}: commit: Image gallery
25266ce HEAD@{16}: checkout: moving from master to imagegallery
25266ce HEAD@{17}: checkout: moving from jsfirst to master
cc0cdad (jsfirst) HEAD@{18}: commit: Silly story
a52170c HEAD@{19}: checkout: moving from master to jsfirst
25266ce HEAD@{20}: checkout: moving from jsfirst to master
a52170c HEAD@{21}: commit: Using events in JS
c271cdd HEAD@{22}: commit: Added number guessing game
493a155 HEAD@{23}: commit: Learned basic of JS
25266ce HEAD@{24}: checkout: moving from master to jsfirst
25266ce HEAD@{25}: commit (initial): first commit
git reflog命令的输出
* 76ebb92 (HEAD -> master) Merge branches 'master' and 'master' of https://github.com/sometest/test
|\
| * 4f264fe (origin/master) Created CONTRIBUTING.md
| * 1159fe3 Merge pull request #3 from sometest/code_of_conduct-patch-2
| |\
| | * a7184f0 (origin/code_of_conduct-patch-2) Updated code of conduct
| |/
| * 4369922 Merge pull request #2 from sometest/code_of_conduct-patch-1
| |\
| | * 1893331 (origin/code_of_conduct-patch-1) Created CODE_OF_CONDUCT.md
| |/
| * b3fbde0 Created .gitignore
| * 6275e91 Merge pull request #1 from sometest/add-license-1
| |\
| | * 38d02c5 (origin/add-license-1) Create LICENSE
| |/
* | cc0cdad (jsfirst) Silly story
* | a52170c Using events in JS
* | c271cdd Added number guessing game
* | 493a155 Learned basic of JS
|/
| * 564903c (imagegallery) Image gallery
|/
* 25266ce first commit
76ebb92 (HEAD -> master) HEAD@{0}: reset: moving to HEAD
76ebb92 (HEAD -> master) HEAD@{1}: checkout: moving from 564903c3078ffdbdbd43bceb3da3495daddf82da to master
564903c (imagegallery) HEAD@{2}: checkout: moving from master to 564903c
76ebb92 (HEAD -> master) HEAD@{3}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{4}: checkout: moving from master to imagegallery
76ebb92 (HEAD -> master) HEAD@{5}: pull: Merge made by the 'recursive' strategy.
cc0cdad (jsfirst) HEAD@{6}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{7}: checkout: moving from master to imagegallery
cc0cdad (jsfirst) HEAD@{8}: reset: moving to cc0cdad
25266ce HEAD@{9}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{10}: checkout: moving from master to imagegallery
25266ce HEAD@{11}: checkout: moving from imagegallery to master
564903c (imagegallery) HEAD@{12}: checkout: moving from master to imagegallery
25266ce HEAD@{13}: checkout: moving from jsfirst to master
cc0cdad (jsfirst) HEAD@{14}: checkout: moving from imagegallery to jsfirst
564903c (imagegallery) HEAD@{15}: commit: Image gallery
25266ce HEAD@{16}: checkout: moving from master to imagegallery
25266ce HEAD@{17}: checkout: moving from jsfirst to master
cc0cdad (jsfirst) HEAD@{18}: commit: Silly story
a52170c HEAD@{19}: checkout: moving from master to jsfirst
25266ce HEAD@{20}: checkout: moving from jsfirst to master
a52170c HEAD@{21}: commit: Using events in JS
c271cdd HEAD@{22}: commit: Added number guessing game
493a155 HEAD@{23}: commit: Learned basic of JS
25266ce HEAD@{24}: checkout: moving from master to jsfirst
25266ce HEAD@{25}: commit (initial): first commit
Git命令历史记录
4221 git init
4222 git add README.md
4223 git commit -m "first commit"
4224 git remote add origin https://github.com/sometest/sometest.git
4225 git push -u origin master
4233 git checkout -b jsfirst
4235 git add chapter-1/hello.html
4236 git add README.md
4238 git commit -m "Learned basic of JS"
4241 git add chapter-1/numberguessinggame.html
4242 git commit -m "Added number guessing game"
4247 git add chapter-1/basic2/*
4249 git commit -m "Using events in JS"
4258 git add assessment-1/sillystorygenerator/*
4259 git commit -m "Silly story"
4262 git checkout master
4265 git add assessment-1/imagegallery/*
4266 git reset assessment-1/imagegallery
4270 git checkout -b imagegallery
4273 git add assessment-1/imagegallery
4274 git commit -m "Image gallery" .
4280 git checkout jsfirst
4284 git checkout master
4285 git merge --squash jsfirst
4287 git checkout imagegallery
4296 git merge --squash imagegallery
4297 git checkout master
4298 git merge --squash imagegallery
4305 git merge --squash imagegallery
4312 git reset --hard cc0cdad
4319 git checkout imagegallery
4323 git checkout master
4326 git pull
4333 git checkout imagegallery
4342 git checkout master
4343 git merge --squash imagegallery
4345 git merge imagegallery
4366* git chekout 564903c
4371* git commit -a -m "Image Gallery"
4372* git checkout master
4376* git commit -a -m "Image Gallery Detach HEAD"
4379* git reset --hard\n
我发现唯一值得回答的问题(因为这是唯一的问题)是:
头{0}
,头{1}
,头{2}
,头{3}
是什么意思
HEAD@{n}
表示n
在当前之前提交HEAD
。因此,HEAD@{1}
将意味着在HEAD
之前提交一次。您还可以使用@~n
作为上述符号的简写(即,使用@~n
而不是头~n
来简化事情)
为什么564903c(imagegallery)图像库分支在图形视图中断开
您需要说明您对所提供的说明/命令的期望,只有这样才能清楚。您提供的数据量非常大,一次就可以读取。没有人有时间去处理这么多的命令(不是指你,而是陈述一个真实的案例)。你需要有点具体的东西(更多关于这下面)
我有一个建议给你,当你在这里发布一个问题时,请其他人复制你回购的当前状态。这意味着尽可能减少冗余指令的数量。例如,这一部分:
4319 git checkout imagegallery
4323 git checkout master
4326 git pull
4333 git checkout imagegallery
4342 git checkout master
包含冗余指令。您可以使用git checkout master
,git pull
,然后是git checkout imagegallery
,来完成这一部分。此外,在执行推送
时,不必使用-u
,尤其是在执行git推送原点
时
顺便说一句,您可能想查看Git提供的关于Git最终用户所面临的各种常见问题的FAQ。也许能帮你一点忙:)
最好显示命令的历史记录和生成的存储库的图表,但您的问题是什么?你的意思是出了问题。你认为哪里出了问题?