Git Workflow – turning a local reposity into a “central” one

I have a local repository with a toy project that has turned out to be more serious than I had thought. So from a single development branch where I have carelessly committed, I have started to use branches kind of like in the famous http://nvie.com/posts/a-successful-git-branching-model/

I would now like to have a “central” remote repository that I can push my develop and master tree.

The first issue is: how do I do this. Do I initialize an empty repository on my server and reference to this repository as the remote origin in my local repository?

Do I have to create the branches in the remote repository beforehand or is it enough just to push them?

Secondly the first commits in my local repository are really awkward, so I would like to cumulate a lot of those early commits into one, either in the way of –no-ff or as I understand to squash them.

As I understand, this is only working with an intermediate branch. i.e. right now I have 2 branches “develop” and “master” in my local repository. I came up with two ideas how to “change history”

I create two branches develop-squashed and master-squashed. Rebase my original branches to those while squashing commits I want to loose. Upon having -squashed branches being equivalent with the original master and develop branches, I can delete the original ones and “rename” the *-squashed branches to master and develop.

Finally I can push master and develop into the remote repository.

  • Is that the way to go?

  • How can I make sure that by rebasing, both branches master and develop both have the same history up to the point when I started to follow the “successful git branching model”? (They have the same history up to that point at the moment).

  1. You have to first clean up the history, than create the central repository on server. Because once you publish the history, you won’t be able to get it back.
  2. If the branches have common history throughout the period you want to modify, than you will only have one “*-squashed” branch. Having develop only makes sense since the point it actually differs from master.
  3. Have a look at the git filter-branch command. It should be able to do all the rebasing for you easily (as far as anything involving filter-branch can be called easy, but it will save you a lot of work in any case). The operation you’ll want to do is basically simple; just for the first commit you want to keep replace the parent with the cleaned up one.
  4. I would probably not bother unless there is anything that you either can’t legally publish or is really very very embarrassing as somebody would have to have a lot of free time to actually look at the early history.
  5. Just initialize empty repository on server, add it as remote and push the branches and tags, yes.

0

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