$ git log commit 4b6999eecb60df46af36c5409e3737e44b877dd7 (HEAD -> master) Author: xxx <xxx@xxx.com> Date: Sun May 19 13:50:07 2019 +0800
create folder and file
commit 6d4192be4c570363865468870d14f59efaa5521e Author: xxx <xxx@xxx.com> Date: Sun May 19 13:46:22 2019 +0800
create abc
commit 4d2bdddf4098e40ce57fdaf04bb862f7bea04918 Author: xxx <xxx@xxx.com> Date: Mon Apr 29 21:36:15 2019 +0800
rename
commit d34df54beffb33cf6e4f4e97d0f0e24f2b676d51 (tag: test) Author: xxx <xxx@xxx.com> Date: Mon Apr 29 21:02:02 2019 +0800
学习工作区和暂存区
commit 33f7ae4c4d4da85453ed0077670e242b71d0a621 Author: xxx <xxx@xxx.com> Date: Sun Apr 28 22:19:09 2019 +0800
Add readme $ git checkout 6d4192 Note: checking out '6d4192'.
You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 6d4192b create abc $ vi abc $ git status HEAD detached at 6d4192b Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)
modified: abc
no changes added to commit (use "git add" and/or "git commit -a") $ git add -u $ git commit -m 'Add hello world' [detached HEAD 4e43c01] Add hello world 1 file changed, 1 insertion(+) $ git log commit 4e43c01c8f3c76aedd986d598a00b90809a3a588 (HEAD) Author: xxx <xxx@xxx.com> Date: Sun May 19 16:33:15 2019 +0800
Add hello world
commit 6d4192be4c570363865468870d14f59efaa5521e Author: xxx <xxx@xxx.com> Date: Sun May 19 13:46:22 2019 +0800
create abc
commit 4d2bdddf4098e40ce57fdaf04bb862f7bea04918 Author: xxx <xxx@xxx.com> Date: Mon Apr 29 21:36:15 2019 +0800
rename
commit d34df54beffb33cf6e4f4e97d0f0e24f2b676d51 (tag: test) Author: xxx <xxx@xxx.com> Date: Mon Apr 29 21:02:02 2019 +0800
学习工作区和暂存区
commit 33f7ae4c4d4da85453ed0077670e242b71d0a621 Author: xxx <xxx@xxx.com> Date: Sun Apr 28 22:19:09 2019 +0800
Add readme $ git branch -av * (HEAD detached from 6d4192b) 4e43c01 Add hello world master 4b6999e create folder and file temp 543c5d8 add test $ git checkout master Warning: you are leaving 1 commit behind, not connected to any of your branches:
4e43c01 Add hello world
If you want to keep it by creating a new branch, this may be a good time to do so with:
git branch <new-branch-name> 4e43c01
Switched to branch 'master' $ gitk --all $ git branch fix_add 4e43c01 $ gitk --all
|