How to collaborate on features using github

github encourages 1 fork per user, so that that user can work independently on a feature and then request that feature to be accepted into the main repository via pull request.

However, what if 2 developers need to collaborate on that feature? What is the ideal workflow for this? I could see a number of options:

  1. Both developers fork the original repository. Each developer pulls/pushes changes between each other’s repository. This seems like a lot of work (tiny micro operations) and also creates a delay between changes, so increases the window for conflicts.
  2. Developer 1 forks from the main repository, developer 2 forks from developer 1. Same as #1 mainly but hopefully simplifies Developer 2’s life a little?
  3. Developer 1 gives Developer 2 permissions to his own fork, so they both work out of the same central repository. Not sure if this is ideal.

I’m also curious where branches come into this. Obviously there would be a branch for the feature itself but that branch can’t exist in a single place, it would have to exist on multiple forks and be synchronized.

Basically just really confused about this workflow, would like an approach for how this can be best accomplished.

4

Create a feature branch for the functionality that you’d like to implement.

Both developers will pull a local copy of the feature branch. They can push incremental progress to the feature branch, and conflicts will be resolved via merging, should they arise.

EDIT

The way I would approach this problem:

  1. From the main, up to date repository, create a branch git checkout -b FeatureBranch
  2. Both users checkout this branch git fetch and git checkout FeatureBranch
  3. Now each user has a local copy of FeatureBranch on their machine
  4. Each user is able to progress individually on their local branch, committing changes as they please. When enough progress is made, they can each push their changes to the remote branch git push origin FeatureBranch. Git will handle merging automatically, unless a conflict arises that cannot be automatically resolved. In this event, the pusher will have to manually resolve it.
  5. When the feature branch is ready to be merged back into master, issue a pull request, or git merge

FYI I think you have your terminology mixed up in your post. Users should create a branch from the master branch, and upon completion of their work, they issue a pull request and the admins can decide to merge it in or not. Forking, at least in my mind, is reserved for taking a project at a certain point, and heading in a different direction with development. If a feature branch is intended to enhance the current code base, and fits the ideology and paradigm of the project, I would recommend branching.

Perhaps some more background information about your use case would be helpful.

6

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