GitBash Flashcards

1
Q

Initialize

A

$ git init

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

Add Name & Email

A

$ git config –global user.name “YourName”

user.email “your.email@provider.com”

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

Add File

A

$ git add fileName.fileExtension

. for any fileName & fileExtension

. for all

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

Unstage File

A

$ git rm –cached

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

Commit

Commit (Skip Vim Editor)

A

$ git commit

$ git commit -m ‘Changed app.js’

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

Create Ignore File to ignore

and

A

touch .gitignore

.gitingore
|->fileName.fileExtension
|->\folderName

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

Brach put from ‘master’

So that you do not effect the main code

A

$ git branch branchName

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

Go to yourBranch

A

$ git checkout nameOfYourBranch

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

To view remote repository

To add remote repository

A

$ git remote

$ git remote [link from github]

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

Upload to repository

A

$ git push -u repoName master

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

Clone a repository

A

$ git clone [link]

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

Download changed repo

A

$ git pull

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

View git Status
i.e
View Staged Files
View Untracked Files

A

$ git status

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