码迷,mamicode.com
首页 > 其他好文 > 详细

gitlab操作

时间:2015-08-08 10:31:47      阅读:1242      评论:0      收藏:0      [点我收藏+]

标签:gitlab   git   

git的aone开发流程

1.克隆版本库到本地 克隆git@gitlab.alibaba-inc.com:locops/locops_code.git

2.去aone上拉分支,跟svn、的时候一样,暂时选master,develop分支暂时不用,原因在于使用develop分支需要提前合并代码到develop,如果在测试过程中某些分支不发布了,还需要将develop回滚。

3.记住你的分支名,在gui上从远程仓库pull,得到最新版本

4.gui上有个新建本地分支,新建一个,名字取个你自己能记住的,最好和你再aone上拉的名字一样,因为随着开发会有很多分支,名字取的一样比较好记

5.在新建过程中选择跟踪远程分支,选中你在aone上新建的分支,新建完就好了。

6.后面修改代码提交都是可以在eclipse里完成的,注意不要提交到master,提交到你自己的分支就好了,我也做了设置,没有提交master权限的。

7.在aone上部署跟原来svn没有区别,在发布后会有系统自动合并到master分支。

git bash操作

1.首先克隆版本库到本地,以后开发不需要再次克隆,只需要切换分支。

git clone git@gitlab.alibaba-inc.com:locops/locops_code.git ./locops_code

2.在aone上建日常,拉分支,没变化,得到分支地址。git@gitlab.alibaba-inc.com:locops/locops_code.git feature/test_228601

3.本地建分支,同时切换懂啊aone上新拉的分支。请在你克隆到本地的版本库目录下进行。

4.中间过程如果遇到以下情况:

error: the requested upstream branch ‘origin/develop‘ does not exist 请参考下面解决方法:

  • If the branch develop already exists in the remote repository, use git fetch to update your "remote-tracking branches" (local mirrors).
    • This requires that the fetch refspec is set correctly (in .git/config in the section for your remote); the default is fetch = +refs/heads/*:refs/remotes/<name of remote>/*. In some cases, configuration may be set up to fetch only one branch (specific branch name used instead of wildcard). It should be safe to change the configuration; this will allow fetching all branches.
  • If the branch doesn‘t exist yet in the remote repository, you can set up the association while pushing it for the first time: git push -u origin develop (that takes care of what you‘re trying to do with your command at the same time as it pushes the branch)

Ξ code/locops_code git:(master) ? git branch   # 查看现有分支
  develop
* master

Ξ code/locops_code git:(master) ? git branch feature/test_228601  # 创建本地分支,和远程同名是好习惯

Ξ code/locops_code git:(master) ? git branch   # 再看现有分支
  develop
  feature/test_228601
* master

Ξ code/locops_code git:(master) ? git checkout feature/test_228601  # 切换到新分支
Switched to branch ‘feature/test_228601‘

Ξ code/locops_code git:(feature/test_228601) ? git pull   # 尝试从远程pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> feature/test_228601


# 根据报错信息,解决方案是设置远程的upstream分支,并和本地响应分支做绑定
↑1 code/locops_code git:(feature/test_228601) ? git branch --set-upstream-to=origin/feature/test_228601 feature/test_228601
Branch feature/test_228601 set up to track remote branch feature/gittest_140784 from origin.

Ξ code/locops_code git:(feature/test_228601) ? git pull 
Already up-to-date.

Ξ code/locops_code git:(feature/test_228601) ? git status   
On branch feature/test_228601
Your branch is ahead of ‘origin/feature/test_228601‘ by 84 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

4.开发完成后,提交到你的分支就可以了,aone日常部署没有变化。eclipse上可以直接commit和push的。

版权声明:本文为博主原创文章,未经博主允许不得转载。

gitlab操作

标签:gitlab   git   

原文地址:http://blog.csdn.net/scut_flyaway/article/details/47355629

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!