使用Git开发Django项目 [英] Developing Django projects using Git

查看:106
本文介绍了使用Git开发Django项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道有没有人在一个小团队(在我的情况下使用3个Django项目),使用Git源代码控制管理。

I am wondering if anyone has experience working on Django projects in a small team (3 in my case), using Git source control management.

该项目被托管在开发服务器上,这就是为什么我有这样的问题。开发人员在将更改提交到本地存储库之前,无法看到代码是否有效,然后将这些更改推送到服务器。然而,即使这样,git似乎没有更新保存服务器上存储库的目录中的文件 - 可能是因为它仅存储更改以节省空间。

The project is hosted on a development server, which is why I am having such a problem. Developers can't see if their code works until they commit their changes to their local repository, then push those changes to the server. Even then, however, git doesn't seem to be updating the files inside the directory holding the repository on the server - probably because it only stores the changes to save space.

在开展这个项目时,我们开始踩在对方的脚趾上,所以需要一些版本的控制 - 但是我无法找出解决方案。

We are beginning to tread on each other's toes when working on this project, so some kind of version control is required - but I just can't figure out an solution.

如果有人克服了类似的问题,我很乐意听到如何完成。

If anyone has overcome a similar problem I'd love to hear how it can be done.

推荐答案

存储库,最佳结果是远程存储库是没有工作目录的裸存储库。这听起来像在远程存储库上有一个工作目录,Git在推送时不会更新。

When pushing to a remote repository, best results are when the remote repository is a "bare" repository with no working directory. It sounds like you have a working directory on the remote repository, which will not be updated by Git when doing a push.

对于您的情况,我建议开发人员他们自己的测试环境,他们可以在本地测试,然后将其代码推送到其他地方。有一个中心位置,每个人都需要推动他们的工作,甚至可以尝试它将导致许多痛苦和痛苦。

For your situation, I would recommend that developers have their own testing environment that they can test against locally before having to push their code anywhere else. Having one central location where everybody needs to push their work before they can even try it will lead to much pain and suffering.

对于部署,我建议推送到一个中央的裸存储库,然后让一个进程将部署服务器将最新的代码从中央存储库拉到其工作目录。

For deployment, I would recommend pushing to a central "bare" repository, then having a process where the deployment server pulls the latest code from the central repository into its working directory.

这篇关于使用Git开发Django项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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