简化Git程序 [英] Simplify Git procedure

查看:74
本文介绍了简化Git程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Git在我的生产系统中部署我的项目。我遵循的过程是:


  • 第一次克隆存储库时,在配置文件中进行更改(在任何生产服务器中不同),然后创建一个叫做pro的分支来保存这些变化。生产服务器总是在专业分支中工作。
  • 然后,当有变化,我想更新我的服务器时,我执行一个批处理文件(或多或少) ):

    $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g $ g




我相信git有一个更简单的方法做到这一点,但我不知道如何(也许可以从另一个分支更新一个分支)。 $ c $)

$ g $ f $ g $ git fetch --all
git rebase origin / master

但是,我没有发现任何四线问题;)


I use Git to deploy my projects in my production system. The procedure I follow is:

  • First time I clone the repository, make changes in the config file (different in any production server) and then create a branch called "pro" that keeps these changes. Production server is always working in "pro" branch.
  • Then, when there are changes and I want to update my server I execute a batch file that makes this (more or less):

    git checkout master
    git pull
    git checkout pro
    git rebase master
    

I'm sure that git has a easier way to do this, but I don't know how (perhaps it's possible to update one branch from another). Is just for curiosity and learn more about Git.

解决方案

Should work (on pro)

git fetch --all
git rebase origin/master

However, I don't see any problem with a 4-liner ;)

这篇关于简化Git程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆