First clone your initial repository to a new location (for example, ~/saveMe/initialRepo).
mkdir -p ~/saveMe/initialRepo
cd ~/saveMe/initialRepo
git clone <initial repository URL>
Checkout to the new implementation branch by creating a new local branch. (for example, go-implementation)
git checkout -b go-implementation origin/go-implementation
Create the new repository on Git.
Clone the new repository to a new location. (for example, ~/saveMe/newRepo)
mkdir -p ~/saveMe/newRepository`
cd ~/saveMe/newRepo
git clone <new repository URL>`
Create a new remote inside the new repository (super-awesome-project) for the initial repository (awesome-project)
git remote add initial-repo <path-to-cloned-initial-repository>
Pull all the files and directories from initial repository (awesome-project) go-implementation branch to the master branch of the new repository (super-awesome-project) with preserving history.
git pull initial-repo go-implementation --allow-unrelated-histories
Remove the remote added for the initial repository (awesome-project) inside the new repository (super-awesome-project).
git remote rm initial-repo
Add all changes and push to git.
git add .
git push origin
From the following article,
https://kasunsiyambalapitiya.medium.com/move-git-branch-from-one-repository-to-another-with-preserving-history-81ed64de3a02