Git, Github and Version Control Flashcards

1
Q

What is the best practice when writing the commit message?

A

It’s best practice to use the present tense.

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

What are some Git commands for the terminal?

A
git init (Intialise Git)
git status (See the status of the files in Git)
git add (Add something to Git)
git add . (Add all the files in a directory)
git add .gitignore (dot infront of file name will create a hidden file)
git commit -m ""   (Commit message)
git push (push changes) 
git log (see when which commits were made)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is “Working Directory”?

A

It’s the folder or directory where you initialise your Git repository.

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

What is the “Staging Area”?

A

It’s a good place to figure out what are the things you want Git to ignore and what are the things you want Git to track

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

What is the “Local Repository”?

A

This is the repository that it pushed to Git.

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

What are the commands to revert changes made to a file before it’s pushed?

A

git diff index.html (Show changes that were made)

git checkout index.html (restore its previous version)

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

How do you create repository on Github via the command line?

A

git remote add origin (paste in the URL of the remote repository on github)

Conventional practice is that you name it origin

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

How do you push your local repository to the remote repository?

A

git push -u origin master

The master branch is the default branch of all of your commit

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

What is the “master branch”?

A

It is the main branch of your commits or save points. (Where your main progress is saved or committed)

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

What’s the command for removing all files and folders in a directory?

A

git rm –cached -r .

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

What is cloning and how can you do it?

A

git clone (url of repository from Github)

This pulls down all the commits and versions of a particular remote respository and stores the files inside your working directory.

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