Git Flashcards

1
Q

What does Git Bash do?

A

Helps in organizing and managing versions of our product

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

Initialize Git

A

git init

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

Add to local git

A

Staging area -> git add (filename or .)

Commit -> git commit -m “message here”

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

Update changes

to local git

A

git add .

git commit -m “message here”

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

Branch in local git

A

git branch (branch-name)

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

Switch to branch

A

git checkout (branch-name)

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

Local merge changes from Local

branch

A

switch to the branch or master you wanna merge into and –

git merge (branch-name)

(this will open vim to put in merge comment and you can quit it using ‘:q!’)

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

Push local git to Remote git

A

FIRST POINT THE LOCAL REPOSITORY TO THE REMOTE URL –
git remote add origin (remote_url)
PUSH THE LOCAL FILES TO REMOTE REPOS –
git push origin master

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

Update Remote repos

from Local

A

git push (REMOTENAME) (BRANCHNAME)

Example - git push origin main

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

Merging changes into your local branch

A

git merge (remote-name/branch-name)

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

Pulling changes from a remote repository

A

git pull (remote-name) (branch-name)

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