Commands Flashcards

1
Q

git config

A

allows you to set configuration variables

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

git config –system

A

sets configuration variables for every user on the system

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

git config –global

A

set configuration variables specific to your user

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

git config –local

A

set configuration variables specific to the repository

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

git –help

A

git command and a list of the most commonly used Git commands are printed on the standard output.

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

git clone [localpath]

A

Clone a working copy of local repository into a new directory

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

git clone [url] directoryname

A

Clone a repository into a new directory using a remote server

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

git commit -m ‘initial project version’

A

Initial commit to start version-controlling existing files

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

git add
OR
git add *

A

racking tool add new file contents to the index, stage files, and to do other things like marking merge-conflicted files as resolved

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

git status

A

tool to determine which files are in which state, to determine which files have changed that are staged for the next commit

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

.gitignore

A

A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected

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

git diff

A

Shows you the exact lines added and removed

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

git diff –staged
OR
git diff –cached

A

This command compares your staged changes to your last commit

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

git rm

A

Remove files from the working tree and from the index. The files being removed have to be identical to the tip of the branch.

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

git rm –cached

A

keep the file on your hard drive but not have Git track it anymore

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

git rm *~

A

Removes all files that end with ~

17
Q

git mv file_from file_to

A

Rename a file in Git, no metadata is stored in Git that tells it you renamed the file.

18
Q

git log

A

Lists the commits made in that repository in reverse chronological order.

19
Q

git log –pretty=format: “%h | “%an %ar : %s” –since=2.weeks

A

20
Q

git commit -m ‘initial commit’
git add forgotten_file
git commit –amend

A

Add/Change files in last commit

21
Q

$ git reset HEAD

A

Unstaging a Staged File

22
Q

git checkout –

A

Unmodifying a Modified File: revert back to last commit

23
Q

git remote

A

Lists the shortnames of each remote handle you’ve specified.

24
Q

git tag

A

See that you’ve tagged the commit.

25
Q

git tag v1.0-lw

A

Lightweight Tag

26
Q

git tag -a v1.4 -m ‘my version 1.4’

A

Annotated Tag

27
Q

git tag -a v1.2 9fceb02

A

Tag a previous comment

28
Q

git config –global alias.st status

A

Create short cuts st for status command.