在网络上设置Git并复制到网站 [英] Setting up Git on Network and the copying to website

查看:102
本文介绍了在网络上设置Git并复制到网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一位Git新手,对我如何在环境的限制之内设置问题有疑问,希望有人能帮助我,让我知道我的想法是否正确。



我们的IT部门不希望在我们的Staging Server上安装Git,因此我们认为我们必须使用网络驱动器。计划是这样的:


  • 网络上的Git存储库
  • Localhost开发机器从网络存储库中拉出,
  • 手动从存储库复制到登台Web服务器(您是否导出版本或直接复制内容?)

  • > IT进行安全测试并将更改复制到生产Web服务器(我们无法访问生产服务器)



这看起来像一个好的计划,这是一个好方法来使用Git吗?



谢谢!

解决方案

这是使用git的绝对好方法。我会非常推荐它。使用修订控制是一个非常关键的关键,在开发优质代码时保持健全,这就是它如何进入乔尔测试。如果开发者可以控制他们开发周期的一切,那也是有利的,因为这种方式在开发中没有瓶颈。而且,IT能够在自己的系统上保持自主性听起来也是一个好主意。所以它可以是一个双赢的局面。

我会为每个修订版本添加标签(使用一些任意的修订版本号系统),然后将其复制到临时环境中 - 或者可能不是字面上每一个版本的复制,但是过度标记不会造成任何伤害,如果您标记不足并且之后不能恢复到其他修订,那将是非常不幸的。



为了将文件复制到登台服务器上,我会查看诸如 rsync <一>。这将使复制变化比重新启动整个副本更加直接。在网络驱动器上, git checkout 确切的修订版本要复制到临时文件中,然后在您的结尾做任何测试,然后告诉rsync同步这两个文件电脑(如果你使用的话,你必须弄清rsync)。所以,是的,你会直接从网络服务器复制文件。



另外,考虑有一些文件本身的标志修订号的想法(包括git SHA -1 hash),这样当文件被复制到登台服务器时,你就会知道到底是哪个版本。



最后,这里是另一个链接到更多信息的链接关于git分支可能会帮助你,也许不会帮你:一个成功的git分支模型



-



如果您有任何意见/问题,请发表以下评论。

>

I am a Git newbie and have a question about how I should set it up within the restraints of our environment, and hoping someone can help me out and let me know if my thinking is correct.

Our IT department would prefer not to have Git installed on our Staging Server, so we're thinking we'll have to use a network drive. The plan is this:

  • Git repository on network
  • Localhost development machines pull from network repository, make changes, push back to repository
  • manually copy from repository to staging web server (do you export a version or just copy the contents directly?)
  • IT does security testing and copies changes to production web server (we do not have access to production server)

Does this seem like a good plan and is this an okay way to use Git?

Thanks!

解决方案

This is definitely a good way to use git. I would very much recommend it. Using revision control at all is a very crucial key to staying sane while developing good code, and that's how it made its way onto the Joel Test. If the developers can control everything about their development cycle, that is also advantageous because that way there is no bottle neck in development. Also, IT being able to keep autonomy over there own systems sounds like a good idea as well. So it can be a win-win situation.

I would tag (with some arbitrary revision-number system) every single revision which you copy over to the staging environment -- or maybe not literally every revision you copy over, but there is no harm in over-tagging, and it would be very unfortunate if you under-tagged and cannot revert back to some other revision afterwards.

For copying files over to the staging server, I would look into a tool like rsync. That will make copying changes much more immediate than having to restart a whole copy. On the network drive, git checkout the exact revision you will want to copy over to staging, then do whatever testing you do on your end, and then tell rsync to sync the two computers (you will have to figure out rsync if you use it). So, yes, you will copy the files directly from the network server.

Also, consider the idea of having some file itself which marks the revision number (including the git SHA-1 hash) so that when the files get copied over to the staging server, you will know exactly which version is there.

Finally, here is another link to more information about git branching which may or may not help you out: a successful git branching model

--

post any comments below if you have any comments/questions.

这篇关于在网络上设置Git并复制到网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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