---
title: "git 分支管理"
author: "ericchan2012"
date: "2012-12-13T14:03:24Z"
tags: []
categories: ["移动开发"]
slug: "git"
draft: false
lastmod: "2012-12-13T14:03:24Z"
id: 1747091
url: "https://ericchan2012.iteye.com/blog/1747091"
---

在服务器端建立一个branch
git branch test

然后在客户端拉版本的时候
1，git clone -b test server地址
2，git checkout -b develop test//在客户端新建一个develop分支并切换过去

这样自己所做的工作都是在develoop分支上
# 切换到test分支
　　git checkout test
# 对Develop分支进行合并
　　git merge --no-ff develop

$ git push origin test:master         // 提交本地test分支作为远程的master分支
$ git push origin test:test              // 提交本地test分支作为远程的test分支

git branch -m oldname newname//重命名branch名字
删除feature分支：
　　git branch -d feature-x


http://gogojimmy.net/2012/01/21/how-to-use-git-2-basic-usage-and-worflow/
http://www.ruanyifeng.com/blog/2012/07/git.html
http://www.cnblogs.com/wangkangluo1/archive/2011/09/02/2164313.html
http://weli.iteye.com/blog/1441582
http://kb.cnblogs.com/page/132209/