git: having separate folder for development, why?

until now I was using dropbox as my main vcs (it is not, but for a single dev does the job pretty decent).

However I decided to give git a go and see if it fits my needs. Today I was reading this tutorial and at some point it says:

One of the things you should get used to is doing development in a
separate area, not where you’re serving your files from, for obvious
reasons

I am doing development in django, and I can’t find these “obvious reasons”. Why can’t I just use my project’s folder to serve files to github?

I would be happy if someone clarified this for me now that I am new to git.

3

I’m the author of the blog post in question. To clarify, what was meant was not that you shouldn’t use the same directory to “serve files to GitHub”, but rather you shouldn’t do development in the same directory that your web server serves your content from.

Hope that clears things up.

1

This really has nothing to do with Git. It’s a bad idea in general to edit a live website while your users are using it. You should make sure that your edits are complete, then “go live”.

0

You’re not supposed to expose your versioning control files on “published” servers as private information may be gleaned from them that would aid in an attack on your system.

1

The advice to “develop in a separate area” is not specific to git. It’s very popular to have a “development” environment that’s separate from the “production” environment. The production environment (where you serve your files from) is only for code that has been tested and is complete and working.

The development environment is where you do the actual work. Here, you’re free to break things, leave something half-finished and go to bed, try a feature and remove it, take your time working on a large change, roll back to an old version, really just do whatever you want.

And while you’re messing with the development version, breaking it and putting it back together, all the user ever sees is the production version, which should be working properly at all times.

The tutorial is explaining how to set this up quickly with git, but git is not required to use multiple environments, and multiple environments are not required to use git.

I think the meaning is that you should release only stable and working versions, and not every intermediate (maybe broken) version you get when you are working on a new feature.

So you should make sure that whenever someone logs on your website, it should work reasonably well.

This is done by developping in a git repository, and deploying a working versions in the production directory when you are ready to do so.

This tutorial suggests that you use fabric for such deployements. I have never used it, but it is a well know deployement framework, and might be a sane choice in most cases.

You may think that i can guarantee there is no bugs in the codes, caus i am an excellent programer and i make no mistakes.
But the truth is you make mistakes sometime.
If you code in the directory which serving the clients, the clients get unstable service, let’s say one client change his balance in the bank the moment you just modify a py file and make a wrong indent. As a result, the client may get a 500 error, what a urgly page it is.
Doing development in a separate area also guarantee you a runnable project. It also make sense if you doing development under a dev branch instead of a new directory.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật