Starting a new repository

Turning a folder you already have into one Git is watching.

File ▸ Initialize Repository… makes a folder into a Git repository.

Nothing in the folder moves and nothing is deleted. A .git directory appears alongside what is already there, and everything in the folder shows up in the working copy as untracked — Git has now been introduced to the folder but has not been told to remember anything in it yet.

What to do next

  1. Look at what is listed. A fresh project usually has things in it that should never be committed: build output, dependency folders, an editor’s cache. Add them to .gitignore from their rows before you stage anything.
  2. Stage what should be in the first commit — often everything that is left, with Repository ▸ Stage All (⇧⌘A).
  3. Write a message and commit.

Connecting it to a server later

An initialised repository has no remote, which is why the sidebar’s Remotes entry reads “No remotes configured” and the status bar offers nothing to pull or push: those two appear only when there are commits on one side that are not on the other.

Create an empty repository on GitHub, GitLab or wherever you keep them, then add it as a remote — see managing remotes. The first push establishes the upstream, and the counts start meaning something.