Here are all necessary steps if you need to migrate a github repository from one organization to another and you want to include history of commits, branches, and tags:

1.Open terminal and clone the source repo using the following command:

git clone --bare https://github.com/sourcerepo.git

  1. It will create a local folder i.e. sourcerepo.git, cd into it

  2. Push the change to the target folder using the following command:

git push --mirror https://github.com/targetrepo.git