git pull与本地更改

问题描述:

我有一个开发克隆和一个git存储库的实时克隆,它从开发开始并开始运行.我遇到的问题是,一旦配置文件进入实时工作副本,就需要对其进行更改.一切正常,直到我更改了一个配置文件的结构-当我将其拉下时,存在两个问题:

I have a development clone and a live clone of a git repository, pushing from development and pulling to live. I'm having a problem in that configuration files need to be changed once they get to the live working copy. This was all working fine until I changed the structure of one of my configuration files - when I went to pull it down, there were 2 problems:

  1. 我的配置文件不是最新的,因此无法将更改拉到该特定文件(我原以为事情会被合并)
  2. 然后我尝试再次进行git pull,并看到所有内容都是最新的,当查看文件时表明它显然不是最新的.

关于git的工作原理,我可能还不了解一些基本知识-最好是创建一个活动分支来修改配置文件,然后在拉入master文件夹后合并,还是有办法解决我看不到的问题?

There's probably something fundamental I'm not understanding about how git works - is it best to create a live branch for modifying configuration files, then merging after pulling to master, or is there a way around this I'm not seeing?

我已经通过创建实时"分支来解决此问题,该分支仅用于配置和诸如此类的事情.意味着我所有的配置都可以进入该目录,然后在需要实时设置的地方签出实时服务器上的实时分支并将更改合并到该分支中.考虑一下,无论如何我都应该真的做到这一点-git迫使我改善了这样做的方式!谢谢,git.

I've worked around this by creating a "live" branch, purely for configuration and things like that. Means that all my configuration can go into there, then I checkout the live branch on the live server and merge changes into it any time I need to set things live. Thinking about it, I should've really done this all along anyway - git forced me to improve the way I do this! Thanks, git.