GIT使用记录

1.git reset

原理:git reset的作用是修改HEAD的位置。

2.git reflog

92ac029 HEAD@{0}: commit: add example 9c58081 HEAD@{1}: reset: moving to HEAD^ 3a6ac66 HEAD@{2}: commit: add superpoint example 9c58081 HEAD@{3}: checkout: moving from add-orb-pytorch to add-orb-pytorch-caffe 3fd099d HEAD@{4}: commit: add 1c7396e HEAD@{5}: reset: moving to HEAD^ 6321e32 HEAD@{6}: reset: moving to 6321e32 1c7396e HEAD@{7}: reset: moving to 1c7396e 6321e32 HEAD@{8}: reset: moving to 6321e32 1c7396e HEAD@{9}: reset: moving to HEAD^ 3791d62 HEAD@{10}: commit: test 1c7396e HEAD@{11}: reset: moving to HEAD^ 6321e32 HEAD@{12}: commit: fix many bugs such as existfile

前面的就是commit id

3.git log

commit 92ac029d1c6c39968ab7efba22d67c0b9898c298 Author: zoeyuchao <zoeyuchao@1625360790@qq.com> Date: Sun Jul 28 12:12:08 2019 +0800 add example commit 9c58081b73a92fdd342b593cc665e4e22cc6fb57 Author: zoeyuchao <zoeyuchao@1625360790@qq.com> Date: Sat Jul 27 17:37:52 2019 +0800 new commit 64d1386984adc0c9a74c4c6a9a12840be7110f3b Author: zoeyuchao <zoeyuchao@1625360790@qq.com> Date: Sat Jul 27 17:35:27 2019 +0800 delete

4.git checkout

5.gitignore不生效

git rm -r --cached .

6.不需要每次都输入密码

git config credential.helper store