Redefine the sequence of small commits into a logical block commit

In some settings, I use git locally and then export diff, which then ships with a detailed description. Thus, when I develop locally, I record constant work and do not worry about significant messages about the completion or perfect testing before committing.

However, when using git to publish code to github, I would prefer to erase the history of these small commits and create only one commit that represents a logically verified change.

What would be the best way to achieve this without altering my local committing process when it seems to me that I have explored a small path (though not proven)?

+3
source share
2

GIT / GIT ", :

  • git rebase --interactive --fixup , rebase --interactive, , ( : )
  • git rebase --interactive --autosquash .

-, , .
- " ".
"squash! my activity"

( ).

, , - git rebase --interactive --autosquash , , .


OP namin GIT : , Public Releases , git merge --squash:

(. :

)

alt text

3 :

  • master. .
  • release. . .
  • github_master. "release", , . github/master.

github_master.

git checkout github_master

github_master, .
GIT git merge --squash. ref, . "1.0.0" .

git merge --squash release
git commit -m "1.0.0"
git tag 1.0.0 -m "1.0.0"

, github.
HEAD github.

git push github HEAD:master

, : , .

, GIT , , , . GIT , , , , .

git push origin github_master

git checkout release
git merge github_master
git push origin release

git checkout master
git merge release
git push origin master
+4

git -rebase. , . , , . Git , , , , .

+2

Source: https://habr.com/ru/post/1758461/


All Articles