From Wikibooks, open books for an open world < Git Jump to:
navigation, search  Here, we will introduce the simplest git
commands: creating a new repository, adding and committing
files, removing files, reverting bad commits, throwing away
uncommitted changes, and viewing a file as of a certain commit.
Creating a git repository[edit]  Creating a new git repository
is simple. There are two commands that cover this functionality:
git-init, and git-clone. Cloning a pre-existing repository will
be covered later. For now, let's create a new repository in a
new directory:  $ git init myrepo  Initialized empty Git
repository in:    1. /home/username/myrepo/.git/ on Linux.   2.
C:/Users/username/myrepo/.git/ on Windows.  If you already have
a directory you want to turn into a git repository:  $ cd
$my_preexisting_repo $ git init  Taking the first example, let's
look what happened:  $ cd myrepo $ ls -a .  ..  .git  The
totality of your repository will be contained within the .git
directory. Conversely, some SCMs leav