GIT and different versions of a project: what are the best practices?

I’m very new in using GIT as a versioning system and despite a lot of searches, I can’t seem to really understand how to handle my scenario.

I have this web project that needs to be developed in two versions:

  • the first is a general version used for demos
  • the second is a customized version for my client.

As for now, the second versions differs in minor things, mainly branding (i.e. icons, some titles) and database connections.

The idea is to enhance its code with suggestions and real use cases provided by the client and, as we progress with bugfixes and new features, port the changes to the “general/unbranded version” – but keeping those minor differences.

In the future the “general” version could be forked and enhanced more with some independent features.

Are branches an useful way to deal with this scenario? I think they’re not, as (at least so I understood) they’re more meant to make changes to be merged back in short- or mid-term.

Take a look here:

https://stackoverflow.com/questions/19840921/override-configured-user-for-a-single-git-commit/19841122#19841122

Although the question is somewhat different, the answers provided by myself and others explain how you can create 2 separate/local git versions of the same system.

Based on what you’re trying to do, I would think of a “Master/Slave” scenario, where the demo (=Master) is where most of the work will be done. You can then fork over the demo into a separate folder and run git on that, where you can do work on it (meaning a you will need to see .git in each custom folder where work is being done)

Now when you do updates to the demo and would like to see these updates in your “slave” custom work, you will need to merge the new “master” with the “slave” on the custom-work(=slave) folder.

That way:

  • The demo project always remains a demo
  • Custom work is kept separate
  • You can create as many different customs as you like, each with their
    own version control
  • You can merge updated demo work to each custom,
    without mixing up the core demo (you need to remember and learn how
    to merge onto the slave)

Take a look at this video for using git: http://vimeo.com/46010208

Somebody once referred it to me for learning git and I found it very useful, that is why I am referring it to you.

1

Push/pull and forking…

Having thought about this for a while, I believe that “forking” pattern – with a push/pull system for specific features you wish to migrate – might be your best option.

It is this pattern that is used by large open source communities to have a single ‘master’ (official copy?) and many many development branches/repos etc.

It is possible to do this using only git (eg adding an upstream remote and also this). It is extremely easy to do it within Github however, so for simplicity I shall describe only the Github workflow.

Setup:

  1. You create your ‘master’ repository
    • this is your ‘polished’ / ‘demo copy
  2. You ‘fork’ this repository
    • this is your ‘development’ copy

Development workflow:

You develop in this second repository, and then when you are ready to “push” features to your ‘demo’ repository, you can submit a pull request from your development repo (containing the desired changes) to your demo repo.

Branches?

This can all be done via branches however, in my mind at least, I prefer to keep the two much more distinct.

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