I am experimenting with git reset
and get some results I don't understand.
First lets check git log --oneline
:
bebf9f0 (HEAD -> main, [MyRepository]/main) Merge branch 'main' of https://github.com/[MyRepository] into main
b20fac7 Merge branch 'main' of https://github.com/[MyRepository] into main # AFTER RESET
7730202 Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
dc8f500 Test amend. # COMMIT REMOVED DURING RESET
705cfac Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
c8971ef Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
bd2e51f Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
8aa0cc0 Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
5d29b9f Merge branch 'main' of https://github.com/[MyRepository] into main # COMMIT REMOVED DURING RESET
62d3662 Merge branch 'main' of https://github.com/[MyRepository] into main
13eb820 Merge branch 'main' of https://github.com/[MyRepository] into main
3ad7a4f Changed comments Testen Untar
16e44fe Changed comments Testen Untar
ae10673 Add Week01 "Testen Untar" - big files ignored
2096cfb Test opruimen
78cfc4c Test2
6210855 Test1
bb7fa9a Test
85a1a7a Update .gitignore
bfe32c6 Update gitignore
2d2277c Add Week01 Testen Unzip
9290c15 Initial
Then I do a git reset HEAD~1
and check git log --oneline
and git status
:
b20fac7 (HEAD -> main) Merge branch 'main' of https://github.com/[MyRepository] into main
62d3662 Merge branch 'main' of https://github.com/[MyRepository] into main
13eb820 Merge branch 'main' of https://github.com/[MyRepository] into main
3ad7a4f Changed comments Testen Untar
16e44fe Changed comments Testen Untar
ae10673 Add Week01 "Testen Untar" - big files ignored
2096cfb Test opruimen
78cfc4c Test2
6210855 Test1
bb7fa9a Test
85a1a7a Update .gitignore
bfe32c6 Update gitignore
2d2277c Add Week01 Testen Unzip
9290c15 Initial
On branch main
Your branch is behind '[MyRepository]/main' by 8 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
Git moved one commit back to b20fac7 which I expected.
However Git also removed the older commits 7730202,..., 5d29b9f and says I am 8 instead of 1 commit behind the remote repository which I don't understand. Does anyone know what happened?
Update
Following the suggestion from user j6t I ran git log --oneline --graph
:
(And now Im trying to figure out what I am looking at..)