Sangam-Git

Clone: getting a copy of a project

Cloning means downloading a full copy of a repository — all its files and its entire history — from a server onto your laptop, so you can start working on it.

Say you just joined a startup in Bengaluru. On day one, the team's payments service already lives on Sangam-Git. To work on it, you clone it. Now you have your own complete copy, connected back to the team's shared copy.

How to clone

Copy the repository's URL from Sangam-Git (there's a Clone button on the repo page), then:

git clone https://sangam.example.com/acme/payments.git

Git creates a new folder called payments, downloads everything into it, and sets up the connection to the server automatically. Step inside:

cd payments

You're now in a working repository. You can read all the code, see the full history with git log, make branches, and commit — all on your own machine.

Clone vs init

Two ways a repo appears on your laptop:

  • git init — you start a brand-new empty repo (see the repository page).
  • git clone — you copy an existing repo from a server.

On a team, you'll clone far more often than you'll init. Most of the time the project already exists and you're joining it.

What you get with a clone

A clone is a real, complete repository — not a read-only view:

  • Every file, at the latest version.
  • The full history — every commit anyone ever made.
  • A link back to the server, called a remote (named origin by default). This is how you'll later push your work up and pull teammates' work down.

Because you have the whole history locally, most Git commands work instantly and even offline. You only need the network to sync with the team (push and pull).

Cloning a private repo

If the repo is private, Git will ask who you are. On Sangam-Git you use your username and an access token as the password — never your real account password. You create a token under Settings → Tokens.

git clone https://sangam.example.com/acme/payments.git
Username: priya
Password: sgm_xxxxxxxxxxxxxxxx   # your access token, not your password

Next: once you've cloned, you'll want to send your changes back to the team and get theirs. That's push and pull.