git clone https://github.com/user/repo.git # into ./repo/
git clone https://github.com/user/repo.git my-dir # into ./my-dir/
git clone --depth 1 url # shallow: only latest commit
git clone does three things automatically:
origingit clone /path/to/repo.git my-copy
cd my-copy
git remote -v
# origin /path/to/repo.git (fetch)
# origin /path/to/repo.git (push)
git log --oneline # see the history
git branch -a # see all branches (local + remote)
git switch -c feature origin/feature # check out a remote branch
A bare repository exists at $BARE. Clone it into a directory called my-clone, then inside the clone make a commit and push it back.
Click "Run" to execute your code.