GIT Memorize Flashcards

1
Q

XML, JSON, YAML - Which one is “hefty” and not very human readable?

A

XML

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

XML, JSON, YAML - Mostly used for transmitting data between server and a web page

A

JSON

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

XML, JSON, YAML - syntax uses curly braces, square brackets, and quotes for its data representation

A

JSON

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

Git check staus

A

Git status

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

Initialize a local git repo

A

Git init

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

Git add files to staging area

A

Git add. Or git add -A

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

Git commit changes

A

Git commit -m “stuff”

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

Git remove a file or folder

A

Git rm -r [filename]

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

List branches

A

Git branch

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

List all branches local and remote

A

Git branch -a

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

Create a new branch

A

git branch [branch name]

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

Delete a branch

A

git branch -d [branch name]

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

Delete a remote branch

A

git push origin –delete [branch name]

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

Create a new branch and switch to it

A

git checkout -b [branch name]

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

Clone a remote branch and switch to it

A

git checkout -b [branch name] origin/[branch name]

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

Rename a local branch

A

git branch -m [old branch name] [new branch name]

17
Q

Switch to a branch

A

git checkout [branch name]

18
Q

Switch to the branch last checked out

A

git checkout -

19
Q

Discard changes to a file

A

git checkout – [file-name.txt]

20
Q

Merge a branch into the active branch

A

git merge [branch name]

21
Q

Merge a branch into a target branch

A

git merge [source branch] [target branch]

22
Q

Stash changes in a dirty working directory

A

git stash

23
Q

Remove all stashed entries

A

git stash clear

24
Q

Push a branch to your remote repository

A

git push origin [branch name]

25
Q

Push changes to remote repository (and remember the branch)

A

git push -u origin [branch name]

26
Q

Push changes to remote repository (remembered branch)

A

git push

27
Q

Delete a remote branch

A

git push origin –delete [branch name]

28
Q

Update local repository to the newest commit

A

git pull

29
Q

Pull changes from remote repository

A

git pull origin [branch name]

30
Q

Add a remote repository

A

git remote add origin ssh://git@github.com/[username]/[repository-name].git

31
Q

Set a repository’s origin branch to SSH

A

git remote set-url origin ssh://git@github.com/[username]/[repository-name].git

32
Q

View changes

A

git log

33
Q

View changes (detailed)

A

git log –summary

34
Q

View changes (briefly)

A

git log –oneline

35
Q

Preview changes before merging

A

git diff [source branch] [target branch]