git commands Flashcards

knowing git command

You may prefer our related Brainscape-certified flashcards:
1
Q

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

A

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

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

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

A

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

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

git config –global color.ui auto

A

set automatic command line coloring for Git for easy reviewing

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

git init

A

initialize an existing directory as a Git repository

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

git clone [url]

A

retrieve an entire repository from a hosted location via URL

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

git status

A

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

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

git add [file]

A

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

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

git reset [file]

A

unstage a file while retaining the changes in working directory

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

git diff

A

diff of what is changed but not staged

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

git diff –staged

A

diff of what is staged but not yet commited

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

git commit -m “[descriptive message]”

A

commit your staged content as a new commit snapshot

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

git branch

A

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

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

git branch [branch-name]

A

create a new branch at the current commit

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

git checkout

A

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

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

git merge [branch]

A

merge the specified branch’s history into the current one

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

git log

A

show all commits in the current branch’s history

17
Q

git log branchB..branchA

A

show the commits on branchA that are not on branchB

18
Q

git log –follow [file]

A

show the commits that changed file, even across renames

19
Q

git diff branchB…branchA

A

show the diff of what is in branchA that is not in branchB

20
Q

git show [SHA]

A

show any object in Git in human-readable format

21
Q

git remote add [alias] [url]

A

add a git URL as an alias

22
Q

git fetch [alias]

A

fetch down all the branches from that Git remote

23
Q

git merge [alias]/[branch]

A

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

24
Q

git push [alias] [branch]

A

Transmit local branch commits to the remote repository branch

25
Q

git pull

A

fetch and merge any commits from the tracking remote branch

26
Q

git rebase [branch]

A

apply any commits of current branch ahead of specified one

27
Q

git reset –hard [commit]

A

clear staging area, rewrite working tree from specified commit

28
Q

logs/
.notes
pattern
/

A

Save a file with desired paterns as .gitignore with either direct string
matches or wildcard globs.

29
Q

git config –global core.excludesfile [file]

A

system wide ignore patern for all local repositories

30
Q

git stash

A

Save modified and staged changes

31
Q

git stash list

A

list stack-order of stashed file changes

32
Q

git stash pop

A

write working from top of stash stack

33
Q

git stash drop

A

discard the changes from top of stash stack