Git - Initializing a Repository

From EdWiki

Revision as of 09:59, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- From Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Initializing a Repository

  • Initializing a Repository in an existing Directory
    If you are starting to track an existing project in Git, you need to go to that project's directory and type
git init

This command creates a new subdirectory named .git that contains necessary repository files.
If you want to start version controlling existing files:

git add *.c
git add README
git add .

Adds files in the current directory recersively

git commit -m "Initial project version"

At this point, you have a Git repository with tracked files and an initial commit.