1

I have a large file that can not be pushed to github and need to do surgery on my local clone. The recommended approach is to use the BFG tool https://rtyley.github.io/bfg-repo-cleaner/: and this requires a local mirror of a remote repo. So how can I make a mirror of the local repo in order to use that tool?

Note that the following question that has a similar title is actually mostly unrelated since it is not dealing with mirroring a local clone: Git local mirror and repository

WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560

1 Answers1

1

"remote" here doesn't mean it has to be on another machine, it just means it's not your current "local" clone of the repository. Git remotes don't require a network or server, you can clone a directory.

git clone /path/to/your/repo

See the "Working With Remotes" chapter of Pro Git for more.


That said, the BFG docs are referring to your existing clone of your Github repository. You don't need to make another clone.

HOWEVER, you might want to make a backup of your clone in case things go wrong. Simply copy the directory. While it's possible to undo what BFG does, it's much simpler to restore from a backup in case things go wrong.

Schwern
  • 153,029
  • 25
  • 195
  • 336