Information Technology Reference
In-Depth Information
There are two remote branches origin/master and origin/john . The
second is a remote tracking branch for the remote john branch created by Sarah in
sarahs-repo . John doesn't need or use it, but it is created anyway. As a conclusion
remember that $ git fetch fetches all of the remote branches and stores them as
remote tracking branches.
This procedure also showed you that you can convert a local tracking branch named
some-branch into ordinary local branches with:
$ git config --unset branch.some-branch.remote
$ git config --unset branch.some-branch.merge
10-6. Working with remote branches
Problem
You and your colleagues want to use a shared repository with many branches , not just
a master branch. It will give you the opportunity to restructure the team into small
groups working on separate features. To work on a specific feature named foo of your
project you want to create a remote branch named foo stored in shared repository.
Developers who work on the foo feature should use the foo remote branch to share
their work.
This recipe provides you with all the commands you will need to work with remote
branches. You will learn how to:
• Create a remote branch with the identical name as the local branch
• Create a remote branch with a different name than local branch
• Remove a remote branch
• Update your repository to reflect the changes in the remote branches
Solution
Create a new directory and initialize a shared repository:
Search WWH ::




Custom Search