通过gitlab(或git)合并分支的最快方法?

Kyl*_*son 7 git bash merge gitlab

我有一个开发分支和一个生产分支.我将更改从我的开发服务器推送到远程gitlab安装.然后我登录到gitlab GUI并执行合并请求(这非常耗时).然后我从我的生产服务器"git pull origin production".

合并请求步骤需要很长时间才能完成.有更快的方法吗?我可以创建一个bash/shell脚本来将开发合并到生产中并使用一个命令下拉更新吗?如果是这样,这个合并请求运行的命令是什么

我每天都会做几次合并请求.任何加快我的过程的事情都会很棒.

nwi*_*ler 10

您可以在不通过UI的情况下合并更改 - 这是Git的核心功能之一.假设您有两个分支(developmentproduction),以下是合并更改的方式:

# Check out development branch
git checkout development

# Make changes, commit...
...

# Optional: Push development changes to the remote
git push origin development

# Check out production branch
git checkout production

# Merge the changes from the development branch
git merge development

# Push the changes to the remote
git push origin production

# Check out the development branch again
git checkout development
Run Code Online (Sandbox Code Playgroud)

现在登录到生产服务器并在那里提取更改.

您当然可以将上述签出/合并/推送步骤放入脚本中 - 这很常见.

有些方法可以在出现变化时自动提取更改.以下是一些链接: