Information Technology Reference
In-Depth Information
changes stored in a revision passed as a parameter. The new revision is always created
at the top of your current branch—it becomes the latest revision in the branch.
You are already familiar with the second command. We used it in Recipe 3-5. This
time we use an ancestor reference HEAD . The reference points to the last but one revi-
sion in a current branch.
5-9. Deleting local branches
Problem
Suppose you have realized that your repository contains stale branches that you will
never need again. You decide to delete them.
Solution
Clone the repository created in Recipe 5-1 and switch to the doc branch:
$ cd git-recipes
$ git clone-with-branches 05-01 05-09
$ cd 05-09
$ git checkout doc
Let's suppose you decided that master and info branches are not important any-
more. To delete the master branch execute:
$ git branch -d master
Next try to delete the info branch with the same command:
$ git branch -d info
The above command fails to remove the info branch because it contains some re-
visions that could be lost. To force the removal use the command:
$ git branch -D info
Search WWH ::




Custom Search