Terminal & Git Basics Flashcards

1
Q

How do you push your code on Github?

A

$ git push origin master

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

How do you go from current directory to parent folder?

A

$ cd ..

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

How do you print the history of the commits of your repository?

A

$ git log
or
$ git lg

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

How do you commit your changes on git?

A

$ git status
$ git add .
$ git commit -m “Your message”

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

What is git?

A

Git is a version control system: it helps you track changes in your code and save versions of it. With git you can also share your code with collaborators.

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

In the terminal, what does . refer to?

A

To current directory

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

How do you create a folded in current directory?

A

$ mkdir folder_name
ex :
$ mkdir restaurants

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

How do you inspect the detailed changes of the modified files identified with git status?

A

$ git diff

$ git diff a_specific_file_or_folder

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

How do you print in the terminal the list of folders and files in current directory?

A

$ ls
or
$ ll

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

How do you create a new git repository locally from scratch?

A

$ mkdir new_project
$ cd new_project
$ git init

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

In the terminal, what does .. refer to ?

A

To parent directory, and you can cd to it
ex:
$ cd ..

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

How do you create a new git repository locally from an existing repo (on Github for instance)?

A

$ git clone github_ssh_clone_url

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

How do you create a file in current directory?

A

$ touch file_name
ex:
$ touch program.rb

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

What is GitHub?

A

Github is a service for developers to host code and their versions (under git management). It makes easier code sharing and collaborating. You can find a lot of open source projects on it.

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

How do you print the path of the current directory in the terminal?

A

$ pwd

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

How do you open your project in Sublime Text?

A

$ stt

17
Q

How do you go back to your computers’s home directory?

A

$ cd

18
Q

How do you go from current directory to any folder?

A

$ cd path_to_folder

19
Q

How can you tell if you have uncommitted changes in your project?

A

$ gst