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

Gitlab使用总结

时间:2016-06-27 17:37:37      阅读:485      评论:0      收藏:0      [点我收藏+]

标签:

Gitlab日常开发流程

1. 从某一功能分支新建一个自己的开发分支

技术分享

二. 将master分支clone到本地

mkdir git-test
cd git-testgit clone http://gitlab.alibaba-inc.com/shanbiao.jsb/temp-code.git
cd temp-codels -lh

三. 切换到自己的开发分支

git branch -a
git checkout new_branch

四. 修改后push到远程仓库

git add -A
git commit
git push

五. 在后台发起Merge request

技术分享

六. 项目管理员对代码进行review,确定是否accpet merge

注意:一般开发中是不会直接将自己的开发分支直接合并到master上的,上面仅供测试。

 

Git常用命令

1.从本地当前分支创建新分支

git checkout -b another_new_branch

扩展:

技术分享
 git checkout -b
usage: git checkout [options] <branch>
   or: git checkout [options] [<branch>] -- <file>...

    -q, --quiet           suppress progress reporting
    -b <branch>           create and checkout a new branch
    -B <branch>           create/reset and checkout a branch
    -l                    create reflog for new branch
    --detach              detach the HEAD at named commit
    -t, --track           set upstream info for new branch
    --orphan <new branch>
                          new unparented branch
    -2, --ours            checkout our version for unmerged files
    -3, --theirs          checkout their version for unmerged files
    -f, --force           force checkout (throw away local modifications)
    -m, --merge           perform a 3-way merge with the new branch
    --overwrite-ignore    update ignored files (default)
    --conflict <style>    conflict style (merge or diff3)
    -p, --patch           select hunks interactively
    --ignore-skip-worktree-bits
                          do not limit pathspecs to sparse entries only
View Code

2.将本地分支推送到远程仓库

要想和其他人分享某个本地分支,你需要把它推送到一个你拥有写权限的远程仓库。

你创建的本地分支不会因为你的写入操作而被自动同步到你引入的远程服务器上,你需要明确地执行推送分支的操作。

换句话说,对于无意分享的分支,你尽管保留为私人分支好了,而只推送那些协同工作要用到的特性分支。

如果你有个叫 serverfix 的分支需要和他人一起开发,可以运行 git push (远程仓库名) (分支名)

git push origin serverfix

3.查看项目日志信息

git log --oneline

 

Gitlab使用总结

标签:

原文地址:http://www.cnblogs.com/crazyacking/p/5620629.html

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