Interview Prep/Git & GitHub/Conflicts, remotes, fetch, pull and push

How does `git clone` differ for HTTPS, SSH and `--mirror`/`--bare`?

IntermediateConceptConflicts, remotes, fetch, pull and push
Answer

HTTPS uses tokens or a credential helper, SSH uses keys. --bare creates a repo with no working tree (used for servers). --mirror is bare plus all refs mapped one-to-one, used for backups and migrations, and git push --mirror replicates every ref.

git clone --mirror git@old:org/repo.git
cd repo.git && git push --mirror git@new:org/repo.git
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push