Git Flashcards

Learn Github (27 cards)

1
Q

show modified files in working directory, staged for your next commit

A

git status

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

add a file as it looks now to your next commit (stage)

A

git add [file]

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

unstage a file while retaining the changes in working directory

A

git reset [file]

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

diff of what is changed but not staged

A

git diff

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

diff of what is staged but not yet commited

A

git diff –staged

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

commit your staged content as a new commit snapshot

A

git commit -m “[descriptive message]”

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

set a name that is identifiable for credit when review version history

A

git config –global user.name “[firstname lastname]”

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

set an email address that will be associated with each history marker

A

git config –global user.email “[valid-email]”

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

set automatic command line coloring for Git for easy reviewing

A

git config –global color.ui auto

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

initialize an existing directory as a Git repository

A

git init

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

retrieve an entire repository from a hosted location via URL

A

git clone [url]

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

list your branches. a * will appear next to the currently active branch

A

git branch

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

create a new branch at the current commit

A

git branch [branch-name]

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

switch to another branch and check it out into your working directory

A

git checkout

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

merge the specified branch’s history into the current one

A

git merge [branch]

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

add a git URL as an alias

A

git remote add [alias] [url]

16
Q

show all commits in the current branch’s history

17
Q

fetch down all the branches from that Git remote

A

git fetch [alias]

18
Q

merge a remote branch into your current branch to bring it up to date

A

git merge [alias]/[branch]

19
Q

Transmit local branch commits to the remote repository branch

A

git push [alias] [branch]

20
Q

fetch and merge any commits from the tracking remote branch

21
Q

apply any commits of current branch ahead of specified one

A

git rebase [branch]

22
Q

clear staging area, rewrite working tree from specified commit

A

git reset –hard [commit]

23
Q

Save modified and staged changes

24
list stack-order of stashed file changes
git stash list
25
write working from top of stash stack
git stash pop
26
discard the changes from top of stash stack
git stash drop