首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件开发 >

git 旁支合并

2012-11-07 
git 分支合并- 在Git命输出中开启颜色显示:$git config color.ui true查看是否设置成功:$git config -l-

git 分支合并
- 在Git命输出中开启颜色显示:
  $git config color.ui true
  查看是否设置成功:
  $git config -l

- 创建本地分支
  $git branch phase1

- 将本地分支提交到远程仓库
  $git push origin phase1

- 获取远程分支
  $git branch -a  //列出所有分支
  $git checkout -b phase1 remotes/origin/phase1 //切换到远程分支
  $git pull yanghg@project:/home/yanghg/workdirs/git/mygit/test/t.git phase1

  为了不再每次pull时指定上面冗长的命令,可以修改.git/config文件如下:
    [branch "phase1"]
       remote = origin
       merge = refs/heads/phase1
- 创建tag
  $git tag phase1
- 列出所有tag
  $git tag -l
  phase1
  stable1
- 根据tag提取出一个特定的版本
  $git archive --format=tar -v phase1 | bzip2 > /tmp/t.tar.bz2
- 删除本地tag
  $git tag -d tag_name
- 将tag推到服务器上
  $git push origin tag_name
- 将tag从服务器上删除 //慎用
  $git push origin :tag_name
- 查看那些分支没有被并入当前分支
  $git branch --no-merge
- 合并分支到主分支
  $git merge phase1
  $ git push master //提交到服务器
- 删除本地分支
  $git branch -d branch-name
- 删除远程分支
  $git push origin :phase1

- 提交修改
 $git push


热点排行