Skip to content

Instantly share code, notes, and snippets.

@Dobrowit
Created November 30, 2024 12:57
Show Gist options
  • Save Dobrowit/3f6b4a354cdb5096487fbb35d3be78ca to your computer and use it in GitHub Desktop.
Save Dobrowit/3f6b4a354cdb5096487fbb35d3be78ca to your computer and use it in GitHub Desktop.
GIT - Przenoszenie rep. A do B z usunięciem A i zachowaniem historii

Scenariusz:

  • przenosimy Repo-A do Repo-B
  • zachowujemy historię Repo-A w Repo-B
  • usuwamy Repo-A

Kroki:

cd <Repo-B>
git remote add <Repo-A> https://github.com/<USER>/<Repo-A>.git
git fetch <Repo-A>
git checkout -b <Repo-A>-branch
git merge <Repo-A>/main --allow-unrelated-histories 
git checkout main
git remote remove <Repo-A> 
git push origin --all 

Na koniec należy zalogować się na GitHub i usunąć Repoo-A:

  • przejdź na adres zgodnie ze schematem https://github.com/<USER>/<Repo-A>/settings
  • kliknij przecisk Delete this repository (na dole strony)
  • postępuj zgodnie z poleceniami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment