existing version; H20, H28,h26,i8
H28,h26,i8 is created from the H20 below.
Requirements: Create a new branch from below H28 continue development.
Ideas:
All the code is placed in the H20 warehouse, first download the H20 full repository, that is, the. git folder content, which is essentially a zip file.
Then remove a branch from the repository (such as H28), which is all the code that synchronizes to a branch (essentially reading a portion of a file from a zip).
Note: At this point the local is the H28 branch, we make the changes are above the H28, but the actual need is that we are on this basis to create a new branch.
Specific implementation code
1. Replicating Server Code
git clone ssh://[email protected]/git/h20/pizza.git D96
2. Switch to a branch
git checkout h28
Note: I was just beginning to wonder if I had not created a branch locally, so I could switch branches. have been the first to start from scratch to create a git repository, the warehouse is empty, where the branch, and now is downloaded from the server to complete the warehouse, the warehouse of course there are branches, otherwise the code how to manage.
3. Create a new branch on top of some basics
Git checkout–b D96
Create a branch and switch to the new branch at the same time.
4. Sync to the server, associate the new branch with the parent branch and make it easy for colleagues to enter together (he is also the same, download the warehouse, just switch branches, not switch h28, and D96, and do not need to create a new branch)
Git push Origin D96
View Main Branch Associations
git branch–a//view Remote Branch
* D96//Local Development Branch
H28//Local Branch
Master//Local Master branch equivalent to H20
Remotes/origin/d92
REMOTES/ORIGIN/D96//New branch above the remote server
Remotes/origin/head–> origin/master//Current branch status on remote server
Git creates a new branch from a remote master server