QUESTIONS AND ANSWERS | lATEST
II II II II II II
$ git config --global user.name "Your Name"
II II II II II II II II II II II
Set the name that will be attached to your commits and tags.
II II II II II
$ git config --global user.email ""
II II II II II II II II II II II II
Set the e-mail address that will be attached to your commits and tags.
II II II II II
$ git config --global color.ui auto
II II II II II
Enable some colorization of Git output.
II II II II
$ git init [project name] II II II II II II II II II II II
Create a new local repository. If [project name] is provided, Git will
II II II II II II II II II II
create a new directory name [project name] and will initialize a II II II II II II II II II II II
repository inside it. If [project name] is not provided, then a new II II II II II II
repository is initialized in the current directory.
II II II II
$ git clone [project url] II II II II II II II II II II
Downloads a project with the entire history from the remote repository.
II II
$ git status II II II II II II II II II
Displays the status of your working directory. Options include new,
II II II II II II II II II II
staged, and modified files. It will retrieve branch name, current commit
II II II II
identifier, and changes pending commit.
II II II
$ git add [file]
II II II II II II II II II II II II II II II II II
Add a file to the staging area. Use in place of the full file path to add all
II II II II II II II II II II
changed files from the current directory down into the directory tree.
II II II
$ git diff [file]II II II II II II II
Show changes between working directory and staging area.
II II II II
$ git diff --staged [file] II II II II II II II II II
Shows any changes between the staging area and the repository.
II II II II
$ git checkout -- [file] II II II II II II II II
Discard changes in working directory. This operation is unrecovera-ble.
II II II
$ git reset [file] II II II II II II II II
Revert your repository to a previous known working state.
II II
$ git commit II II II II II II II II II II
Create a new commit from changes added to the staging area.
II II II II II
The commit must have a message!
II II II
$ git rm [file] II II II II II II II
Remove file from working directory and staging area.
II II
$ git stash
II II II II II II II II II II II
Put current changes in your working directory into stash for later use.
II II II
$ git stash pop II II II II II II II II II
Apply stored stash content into working directory, and clear stash.
II II II
$ git stash drop II II II II II II II II
Delete a specific stash from all your previous stashes.
II II II
$ git branch [-a]