Git Commands Flashcards

1
Q

git init

A

create a local git repository in directory

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

git add

A

move the local git repository to the staging area

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

git commit

A

commit the local repository to the remote repository

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

git config

A

set user name and email in main config file
> git config user.name –global
> git config user.email – global

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

git clone

A

clone git repository from URL

> git clone

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

git status

A

checks the status of the files you’ve changed in working directory, lists all the files that have been changed

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

git push

A

added and committed changes, want to push to remote

> git push

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

git pull

A

grab most recent code from remote

> git pull

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

git branch

A

lists out all the branches

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

git checkout

A

switch to another branch

> git checkout or git checkout -b to create and switch to new branch

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

git stash

A

save changes you don’t want to commit immediately

> git stash (in working directory), git stash apply (to get saved changes back)

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

git merge

A

merge another branch to your current selected branch

> git merge

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