首页 \ 问答 \ 如何在远程测试时设置git开发环境(How to set up a git development environment when you're testing remotely)

如何在远程测试时设置git开发环境(How to set up a git development environment when you're testing remotely)

这看起来似乎是一个愚蠢的问题,但我觉得我对GIT理解得相当好,但我似乎无法按照自己的意愿设置我的开发环境。 我要么缺少一些非常简单的东西,要么就是我错了:)

我在我的服务器上初始化了一个裸git repo,将它克隆到我的本地机器,提交了我的文件并推送到原点。 然后,在本地我创建了三个分支(主,发布,开发)并将它们全部发布到原点。 我打算让多个开发人员从开发分支中撤出,我想确保他们不能推送到主分支,但对于另一个问题可能更好。

现在,我在本地对文件进行了更改,然后将它们上传到测试服务器并通过Web浏览器检查测试服务器。 我不得不想象这是大多数人测试他们的工作的方式,除非他们将他们的计算机配置为Web服务器并安装了php和mysql。 一旦我对我的变化感到满意,我就把它们推到原始仓库,一切正常。

我的挑战在于保持测试服务器与本地计算机同步。 我已经尝试在我的远程测试目录中设置一个repo,并且我已经在我的本地git repo中添加了第二个远程,希望我可以推送到测试仓库,以便将测试服务器上的文件与我的本地文件同步。 但我无法弄清楚如何使用两个遥控器并使它们与我的本地机器保持同步。

如果我创建一个新的本地分支,检查它以开始处理新功能,然后将分支推送到我的测试远程,测试远程上的头仍然是主,而不是我的新功能分支。 因此,我在本地更改功能分支,但是当我通过coda将更改发布到测试服务器时,我实际上是在更改测试仓库的主分支上的文件。 如果我无法将我的测试快照与本地快照保持同步,我不知道如何充分利用gits分支功能。

我在本地开发和测试真的非常重要吗? 当您需要远程测试时,如何使用git建立开发环境? 有一个测试回购完全错误的方式来考虑这个? 必须有一种方法可以拥有多个遥控器,并将它们签出到推送的最新分支,这样您就可以在测试服务器上远程同步本地文件的实例。 请帮忙!


This may seem like a silly question, but I feel like I understand GIT fairly well, and yet I can't seem to set up my development environment as I would like. I'm either missing something really simple, or I'm going about it all wrong :)

I initialized a bare git repo on my server, cloned it to my local machine, committed my files and pushed to origin. Then, locally I created three branches (master, release, develop) and published them all to origin. I intend to have multiple developers pulling from the develop branch, and I would like to make sure they can't push to the master branch but that may be better for a different question.

Now, I make my changes to the files locally, and then upload them to the testing server and check the testing server through the web browser. I would have to imagine that this is how most people test their work unless they have their computers configured as web servers and have php and mysql installed. Once I'm happy with my changes, I push them to the origin repo, and everything works fine.

My challenge comes in keeping the testing server in synch with my local machine. I've tried setting up a repo in my remote testing directory, and I've added a second remote to my local git repo, hoping I could push to the testing repo to synch the files on the testing server with my local files. But I can't figure out how to have two remotes and keep both of them in synch with my local machine.

If I create a new local branch, check it out to start working on a new feature and then push the branch to my testing remote, the head on the testing remote is still master and not my new feature branch. Therefore, i'm making changes locally to a feature branch, but when I publish the changes to the testing server through coda, I'm actually changing files on the master branch of the testing repo. If I can't keep my testing snapshots in synch with my local snapshots, I don't know how to take full advantage of gits branching features.

Is it really that crucial that I am developing AND testing locally? How on earth does one set up a development environment with git when you have to test remotely? Is having a testing repo the completely wrong way to think about this? There must be a way to have multiple remotes and have them checkout to the latest branch that is pushed so you can have an instance of your local files in synch remotely on a testing server. PLEASE HELP!


原文:https://stackoverflow.com/questions/21807396
更新时间:2022-05-19 17:05

最满意答案

我认为你要找的是call_user_func_array()

编辑:类似于:

function do_action($func) {
    $args = func_get_args();
    array_shift($args); // removes the first element
    return call_user_func_array($func, $args); // magic!
}

I think what you're looking for is call_user_func_array().

Edit: Something like:

function do_action($func) {
    $args = func_get_args();
    array_shift($args); // removes the first element
    return call_user_func_array($func, $args); // magic!
}

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)