I would like to know, how you would proceed to make a full local copy of a remote git repository, that can be used in-place of the original repository.
All guides I found so far, describe how to copy a remote git repository to another remote one.
One such guide would be:
How to move a full Git repository:
$ git clone https://github.com/Sample/sample.git
$ cd sample.git
$ git checkout remotes/origin/HEAD
$ git checkout remotes/origin/develop
$ git checkout remotes/origin/master
$ git checkout remotes/origin/micros-integration
$ git checkout remotes/origin/release/0.4.8
$ git checkout remotes/origin/release/0.6.0
$ git checkout remotes/origin/remove-keygen
$ git fetch --tags
$ git remote rm origin
$ git remote add origin https://github.com/Target/target.git
$ git push origin --all
$ git push --tags
Yet another one:
Mirroring a git repository without a local copy:
$ git clone --mirror git@github.com/Sample/sample.git
$ cd upstream-repository.git
$ git push --mirror git@github.com/Target/target.git
So how would you proceed to create a local copy without being linked to the original repository? And what should be done, if you want to only maintain specific branches and remove everything else including all history (pull-requests, code changes,...)?