git clone — Copying a Repository
git clone downloads a complete copy of a remote repository — all files, all branches, all commits, and full history. It also automatically configures the "origin" remote pointing back to the source.
01.What Clone Does in One Command
Running git clone: downloads the entire repository, creates a local folder with the repo name, initializes git inside it, sets up origin pointing to the source URL, checks out the default branch (usually main), creates remote-tracking branches for all remote branches. You go from zero to fully set up in seconds.
02.Cloning Options
Clone into a custom folder name by passing it as a second argument. Use --branch to check out a specific branch immediately. Use --depth 1 for a "shallow clone" that only downloads the latest snapshot — dramatically faster for large repositories when you don't need full history. Use SSH URLs for passwordless authentication.
Commands
What does git clone automatically set up?