Information Technology Reference
In-Depth Information
about remote branches, local tracking branches, and remote tracking branches. Not
only will I show you how to list, create, destroy, and synchronize them but also how
different commands, such as $ git commit and $ git fetch , affect their state.
This chapter will give you a thorough and complete understanding of remote branches,
remote tracking branches, and local tracking branches. By acquiring these skills you
will be ready to join any team working with git.
10-1. Manual cloning
Problem
You want to get a deeper insight into cloning. One way to achieve this is to manually
clone a repository. You want to perform a manual cloning during which every internal
git operation, such as the initialization of a new repository and the fetching of revisions
from the remote end, are executed with a more specialized command. Proceed with this
recipe cloning the https://github.com/creationix/js-git repository.
The js-git project is a preliminary JavaScript implementation of git.
Solution
Create a new directory with:
$ cd git-recipes
$ mkdir 10-01
$ cd 10-01
and then follow these steps:
1. Initialize a new repository with: $ git init
2. Add the URL of the remote end: $ git remote add origin ht-
tps://github.com/creationix/js-git.git
3. Fetch the git database and remote tracking branches from the remote end:
$ git fetch --no-tags origin master:refs/remotes/
origin/master
Search WWH ::




Custom Search