-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 27/05, Chris Walker wrote:
I have a git repo called https://github.com/tonercloud/beertent and which contains two projects, harbour-beertent and harbour-beerguide. But I want to split out harbour-beerguide into a separate repository and also if possible move harbour-beertent up a level so that beertent is empty and just leave that repo as harbour-beertent.
Hi Chris, While you could do it this way by filtering out the content you don't want, you're likely to be left with commits that won't make sense and neither resultant repository will have shared history with the original repository. Additionally, the commit histories won't show what's really happened and I'm a firm believer that they should :) git blame is wonderful ;) So, what I'd recommend is simply something like: $ git clone beertent beerguide To create a new copy of the entire repo, then... $ cd beertent $ git rm -r harbour-beerguide $ git mv harbour-beerternst/* ./ $ git commit -m "Remove beerguide and put beertent at the root" To remove the beerguide folder from the beertent repo and move the beertent content into the root of it. $ cd beerguide $ git rm -r harbour-beertent $ git mv harbour-beerguide/* ./ $ git commit -m "Remove beertent and put beerguide at the root" To do the reverse for the beerguide repository. Don't forget to set a sensible new remote for the new, clone repo: $ git remote set origin git@github.com/tonercloud/beerguide.git Steve -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVZtRcAAoJEL/3HArzwYbRd/YP/j+yWRu6MUVy9WwsToZn1PDZ d4sITdZzwuVnI6gw3yJaAQJjJJUqZLc9ElsiBNwBwO02lHR8MBkR2m/7pv0Mq/8S DFCTRU/U0fkYNwqN2tya2hNcL2D5RgJH6mRsdWlXcI/j14CMt525vzM0+ch7SUgX ROzCk9/S7R1kpsp4MparGP1RCaqMT19tktLfYL6aLJb7/l43/vrDI3niE+0vj1lu R5OHD8m0tv5A9RWDT7P5PuCGdTy6pKfGXCxVXCz1XPhkJzFfdj6kFkYXZq14S4UK Up1z3UdPUj5zLNZnXFJK/gJ9FgdtVbwdk8cka0vuNK3qTvOL2MT5QmkA2M42Or86 J7cw5lgKURxp+gwkOO6W0HuQv1Dpsdf/2f11Is4Qc9F7xQbK6+cUY2hdylYX7LXR 9BJhEwM88SJLPkvyr3aJCrWud8HEF0Yuq/czBqUvWMObpZl9dg/PR+s3q1mNa3Kq 8TXPdTPVYwQP+BsriR/kzmsSbhAKHt74MlHjhc+gQg+V7mak0Vs2Wqa7GVFX53+K IxwlJV2rVrgiISEO3eCnkSQAYFWkGiMFe4xLa/RaL2UfUB/4xFYgsbbP1o7GcDWU RqhBmJbH4seuTq6d3hyv+jVszohUcLpNEsxOKJPKCi7oMDn7QKsyW9GBAu42F+i/ uNBj9A0Bbu00QySpWEuQ =wWPg -----END PGP SIGNATURE-----