Git基本操作
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git 常用的指令和定义

Git操作
$ git logcommit 65901b6c3d9b366788ceffd9c6905b12e34d7068 (HEAD -> a1)Author: Burning Teng <2250911301@qq.com>Date: Thu Jan 2 22:33:56 2020 +0800a1*4commit dbc6f316e6b3c3c23905fe2b8035a3acafe9d4b3Author: Burning Teng <2250911301@qq.com>Date: Thu Jan 2 22:32:26 2020 +0800a1*3commit e93ff79c9c9a4fd7de4938fdcf128923a3eb669aAuthor: Burning Teng <2250911301@qq.com>Date: Thu Jan 2 22:31:09 2020 +0800a1*2commit fe3f58bec8a08ea618f65a87c70ec72d507c2e0a (master)Author: Burning Teng <2250911301@qq.com>Date: Thu Jan 2 01:10:59 2020 +0800a1+a1a1+a1+a1a1+a1+a1+a1a1+a1+a1+a1+a1a1*6a1*4commit 6e8da3d08c7f008eb8f9702f3ee970c90b37325bAuthor: Burning Teng <2250911301@qq.com>Date: Thu Jan 2 01:10:27 2020 +0800a1
无论是修改commit的顺序还是修改commit信息,commit对应的文件信息等,都可以使用git rebase -i 来完成。
$ git rebase -i 6e8da3d08c7f008eb8f9702f3ee970c90b37325b[detached HEAD e5f7eae] a1 no2Date: Thu Jan 2 01:10:59 2020 +08001 file changed, 1 insertion(+), 1 deletion(-)Stopped at e93ff79... a1*2You can amend the commit now, withgit commit --amendOnce you are satisfied with your changes, rungit rebase --continueAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ git branch* (no branch, rebasing a1)a1masterAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ lsa.txtAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ vi a.txtAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ git commit --amend[detached HEAD 43cccc5] a1*2 no3Date: Thu Jan 2 22:31:09 2020 +08001 file changed, 1 insertion(+), 1 deletion(-)Administrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ git branch* (no branch, rebasing a1)a1masterAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ git statusinteractive rebase in progress; onto 6e8da3dLast commands done (2 commands done):reword fe3f58b a1+a1edit e93ff79 a1*2Next commands to do (2 remaining commands):pick dbc6f31 a1*3pick 65901b6 a1*4(use "git rebase --edit-todo" to view and edit)You are currently editing a commit while rebasing branch 'a1' on '6e8da3d'.(use "git commit --amend" to amend the current commit)(use "git rebase --continue" once you are satisfied with your changes)nothing to commit, working tree cleanAdministrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1|REBASE-i 2/4)$ git rebase --continueSuccessfully rebased and updated refs/heads/a1.Administrator@USERUSE-JBTODVE MINGW32 /i/kinggsoft/tt.txt (a1)$ git log --oneline22894ce (HEAD -> a1) a1*456fec42 a1*343cccc5 a1*2 no3e5f7eae a1 no26e8da3d a1
Git补充指令
git remote rm origin
公众号


