The 1st week summary of devtools community in learnku.com
The posted content in the first week of moderator development of devtools community in learnku.com is summarized as follows:
- Fix premature commits that often occur during normal development
$ git rebase -i <commit's ID before the premature commit> # Then you can do whatever you want
- Drop a commit
$ git rebase -i <commit's ID before the will-be-dropped commit>
The git-rebase, fast-forward elaboration from man is worth reading.
How to undo the last commit?
How to change the last commit?
What’s inside a commit?
What happened in a commit?
Branches, tags and HEAD are nothing more than a pointer to a commit.
Note: This article is not very clear and may be rewritten later.
As far as I know, there are three ways to achieve this purpose.
|git-rebase||easy,safe||not very fit for revising a bunch of commits|
|git-filter-branch||fit for batch operation||very dangerous, usage is not easy|
|git-filter-repo||recommended officially, fit for batch ops||not out of the box in Git, need install it|
$ git config --global core.quotePath false
$ git pull --rebase, but keep in mind that change to shared repo commit history is very dangerous!
In short, the distributed workflows is a few personal development processes + a few more remote repositories.