Version Control with Git by Jon Loeliger

Version Control with Git by Jon Loeliger

Author:Jon Loeliger [Jon Loeliger]
Language: eng
Format: epub, mobi, pdf
Tags: COMPUTERS / Software Development & Engineering / General
ISBN: 9780596802431
Publisher: O'Reilly Media
Published: 2009-05-19T16:00:00+00:00


Figure 10-10. Commit graph before git commit --amend

Figure 10-11. Commit graph after git commit --amend

Here, the substance of the C commit is still the same, but it has been altered to obtain C'. The HEAD ref has been changed from the old commit, C, so that it points to the replacement ref, C'.

Rebasing Commits

The git rebase command is used to alter where a sequence of commits is based. This command requires at least the name of the other branch onto which your commits will be relocated. By default, the commits from the current branch that are not already on the other branch are rebased.

A common use for git rebase is to keep a series of commits that you are developing up-to-date with respect to another branch, usually a master branch or a tracking branch from another repository.

In Figure 10-12, two branches have been developed. Originally, the topic branch started on the master branch when it was at commit B. In the meantime, it has progressed to commit E.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.