Skip to content

Commit

Permalink
added commands
Browse files Browse the repository at this point in the history
  • Loading branch information
G1enB1and committed Dec 20, 2017
1 parent 1bb4ac3 commit ae3b5b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-commands.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#git commands

## To start a new local empty repository:
Before you can make commits or do anything else with a git repository, the
repository needs to actually exist.
To create a new repository with Git, we'll use the `git init` command.
Expand All @@ -9,6 +10,7 @@ To create a new repository with Git, we'll use the `git init` command.
The `init` subcommand is short for "initialize", which is helpful because it's
the command that will do all of the initial setup of a repository.

## To clone an existing git repository:
`git clone` // download a copy of an existing repository to the current working
// directory. Current working directory must not already be a git repository.

Expand All @@ -22,6 +24,7 @@ existing repository to a new name. Like this:
Don't forget to `cd` into the newly cloned directory before attempting any
other git commands on it.

## To start with an existing local directory and files:
If you want to start version-controlling existing files (as opposed to an
empty directory), you should probably begin tracking those files and do an
initial commit. You can accomplish that with a few git add commands that
Expand All @@ -34,4 +37,5 @@ specify the files you want to track, followed by a git commit:
We’ll go over what these commands do in just a minute. At this point, you have
a Git repository with tracked files and an initial commit.

## Other git commands:
`git status` // displays information such as which files are in which states.

0 comments on commit ae3b5b1

Please sign in to comment.