Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing Django projects using Git

Tags:

git

django

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

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.

like image 882
Rob Golding Avatar asked May 17 '09 23:05

Rob Golding


People also ask

How do I Git a Django project?

First login into the git account and create a new repository and initialize with README. See the example. My repository name is my-django-app. Click on the create repository button.

Can you host a Django project on GitHub?

Django's Git repository is hosted on GitHub, and it is recommended that you also work using GitHub. Note that user.name should be your real name, not your GitHub nick. GitHub should know the email you use in the user. email field, as this will be used to associate your commits with your GitHub account.


1 Answers

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.

like image 193
Greg Hewgill Avatar answered Sep 19 '22 07:09

Greg Hewgill