The posted content in the first week of moderator development of devtools community in learnku.com is summarized as follows:
How to edit, delete existing commits in Git
- 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>
Some notes about remote repo in Git
Some notes about centralized workflow in Git
The git-rebase, fast-forward elaboration from man is worth reading.
Git articles reading notes 1
How to undo the last commit?
How to change the last commit?
Git articles reading notes 2
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.
less command summary (copied directly from cmd)
[原創] How to revise author name and email in commit history
As far as I know, there are three ways to achieve this purpose.
method | pros | cons |
---|---|---|
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 |
How to add sub-repo as sub-module
Using git-submodule
[原創] How to show chinese character in Git Status
$ git config --global core.quotePath false
[原創] How to pull code when shared repo commit history has been changed
$ git pull --rebase
, but keep in mind that change to shared repo commit history is very dangerous!
Some notes about distributed workflows in Git
In short, the distributed workflows is a few personal development processes + a few more remote repositories.
本作品採用《CC 協議》,轉載必須註明作者和本文連結