7. Git Tools
- 7.1 Revisions-Auswahl
- 7.2 Interactive Staging
- 7.3 Stashing and Cleaning
- 7.4 Ihre Arbeit signieren
- 7.5 Suchen
- 7.6 Rewriting History
- 7.7 Reset Demystified
- 7.8 Fortgeschrittenes Merging
- 7.9 Rerere
- 7.10 Debugging with Git
- 7.11 Submodules
- 7.12 Bundling
- 7.13 Replace
- 7.14 Anmeldeinformationen speichern
- 7.15 Zusammenfassung
10. Git Interna
- A3.1 Setup und Konfiguration
- A3.2 Projekte importieren und erstellen
- A3.3 Einfache Snapshot-Funktionen
- A3.4 Branching und Merging
- A3.5 Sharing and Updating Projects
- A3.6 Inspection and Comparison
- A3.7 Debugging
- A3.8 Patching
- A3.9 Email
- A3.10 External Systems
- A3.11 Administration
- A3.12 Plumbing Commands
A3.8 Appendix C: Git Kommandos - Patching
A few commands in Git are centered around the concept of thinking of commits in terms of the changes they introduce, as though the commit series is a series of patches. These commands help you manage your branches in this manner.
git cherry-pick command is used to take the change introduced in a single Git commit and try to re-introduce it as a new commit on the branch you’re currently on.
This can be useful to only take one or two commits from a branch individually rather than merging in the branch which takes all the changes.
Cherry picking is described and demonstrated in Rebasing und Cherry-Picking Workflows.
git rebase command is basically an automated
It determines a series of commits and then cherry-picks them one by one in the same order somewhere else.
Rebasing is covered in detail in Rebasing, including covering the collaborative issues involved with rebasing branches that are already public.
We use it in practice during an example of splitting your history into two separate repositories in Replace, using the
--onto flag as well.
We go through running into a merge conflict during rebasing in Rerere.
We also use it in an interactive scripting mode with the
-i option in Changing Multiple Commit Messages.
git revert command is essentially a reverse
It creates a new commit that applies the exact opposite of the change introduced in the commit you’re targeting, essentially undoing or reverting it.
We use this in Reverse the commit to undo a merge commit.