Introduction Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what is git?

A
  1. content tracker - tracks all the changes to the code
  2. Distributed version control system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a version control system?

A

Version control system means, you can go back in time to a previous version of the code since git stored it all

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

Why do we say DISTRIBUTED version control system?

A

DISTRIBUTED because, we will have a remote repository which will be stored in a server and a local repository which will be stored in the local machine of every developer.
Every developer has full copy of code base

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

What are the two repositories git has?

A

Local and Remote

Remote repository is usually a centralized server

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

When is a remote repository really useful?

A

When you want to take a backup of your code and when you are working as a team

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

What are the different stages in local repository?

A

The local repository actually consists of three stages. The working area, where all your active changes. Git doesn’t know what to do with them yet, it
just knows that these files contain some
updates.
The staging area contains new
changes that will soon be committed,
and then there are the committed files.

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

How is version control added to the project?

A

By adding commits

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

What is the procedure to commit?

A

The files that should be included in the
commit are first added to the staging area. A
commit gets created when a developer
actually commits those files.

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

for debian based distros, how do we install a package?

A

apt get
eg. sudo apt install git-all

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

How to initialize a a git repo?

A

git init

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

How does git know all of your changes and files?

A

Although we haven’t done anything with Git
yet, we initialized a Git repository in this
project/directory. so Git knows all of our files and their
changes.

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

What is committing in Git repository?

A

Storing changes in a local Git repository is called committing. With every commit, we save the current state of the repository

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

What are untracked files in the output of git status?

A

Untracked files. These are the files that Git
knows of. However, we haven’t told Git what
to do with them. We haven’t told it yet that
we want to add it to our local repository. Eg. Right now, we haven’t told Git what to do with the new
story1 .txt file. It might be that we don’t want
to add that story to our local repository at all.

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

What are the different areas in the local git repository?

A
  1. Working area
    2.staging area
  2. committed files area
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Before committing a file, which area should you put the file in?

A

Staging area using the git add command

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

What is the command to run to commit the files that are in the staging area?

A

git commit -m

17
Q

What happens when a new file is added or created in the working directory?

A

The file is known to be in the working area, and by default it is always untracked first, unless you tell git to track it

18
Q

Which hidden folder gets created after initializing a git repo?

A

.git

19
Q

Command to configure git username and email , to know who committed etc?

A

git user.name
git user.email

20
Q

what command to make a file called notes.txt to take it out from git radar, basically we don’t want git to track this file?

A

echo notes.txt&raquo_space; .gitignore

21
Q

what happens when you add a file to .gitignore for the first time?

A

.gitignore file itself may be listed as untracked. It is a good practice to track the .gitignore file with git.

22
Q

which command shows information about all the commits?

A

git log

23
Q

What are all the information you can get from “git log”

A
  1. commit hash
  2. Author
  3. Date/Time of commit
  4. Commit message
24
Q

What is a short way to see the git log, in case you don’t want to see all the details by default git log provides?

A

git log –oneline

25
Q

“git log” does not list the files that were changed as a part of the commit, how to list the files changed as well?

A

git log –name-only

26
Q
A