GIT Flashcards

Working with Git hub and Cheat Sheets

1
Q

Set the name that will be attached to your commits and tags.

A

git config –global user.name “Your Name”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Set the e-mail address that will be attached to your commits and tags.

A

git config –global user.email “you@example. com”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Create a new local repository in the current directory.

A

git init [project name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Downloads a project with the entire history from the remote repository.

A

git clone <project></project>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Displays the status of your working directory. Options include new, staged, and modified files. I

A

git status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Add a file to the staging area. Use. in place of the full file path to add all changed files from the current directory down into the directory tree.

A

git add [file]
or
git add .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

git commit

A

Create a new commit from changes added to the staging area. The commit must have a message!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Add a file to the staging area. Use. in place of the full file path to add all changed files from the current directory down into the directory tree.

A

git add [file]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show changes between working directory and staging area.

A

git diff [file]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Shows any changes between the staging area and the repository.

A

git diff –staged [file]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Discard changes in working directory. This operation is unrecoverable.

A

git checkout – [file]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Revert some paths in the index (or the whole index) to their state in HEAD.

A

git reset {<path>...]</path>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Remove file from working directory and staging area.

A

git rm [file]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly