GIT - Coursera Flashcards

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

Before changes in new files can be added to the Git directory, what command will tell Git to track our file in the list of changes to be committed?

A

git add

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

Which command would we use to review the commit history for our project?

A

git log

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

What command would we use to make Git track our file?

A

git add

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

Which command would we use to look at our config?

A

git config -l

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

Which command would we use to view pending changes?

A

git status

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

How can a VCS (Version Control System) come in handy when updating your software, even if you’re a solo programmer? Check all that apply.

A
  • Git retains local copies of repositories, resulting in fast operations.
  • If something breaks due to a change, you can fix the problem by reverting to a working version before the change.
  • Git allows you to review the history of your project.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Who is the original creator and main developer of the VCS (Version Control System) tool Git?

A

Linus Torvalds

Linus Torvalds developed Git in 2005 to better facilitate the process of developing the Linux kernel with developers across the globe.

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

_____ is a feature of a software management system that records changes to a file or set of files over time so that you can recall specific versions later.

A

Version control

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

A _____ is a collection of edits which has been submitted to the version control system for safe keeping.

A

commit

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

Within a VCS, project files are organized in centralized locations called _____ where they can be called upon later.

A

repositories

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

Your colleague sent you a patch called fix_names.patch, which fixes a config file called fix_names.conf. What command do you need to run to apply the patch to the config file?

A

patch fix_names.conf < fix_names.patch

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

You’re helping a friend with a bug in a script called fix_permissions.py, which fixes the permissions of a bunch of files. To work on the file, you make a copy and call it fix_permissions_modified.py. What command do you need to run after solving the bug to send the patch to your friend?

A

diff fix_permissions.py fix_permissions_modified.py > fix_permissions.patch

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

The _____ commandhighlights the words that changed in a file instead of working line by line.

A

wdiff

The wdiff command highlights the words that changed in a file by color, in addition to working line by line.

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

How can we choose the return value our script returns when it finishes?

A

Using the exit command from the sys module.

A script can use sys.exit to finish processing and return the number passed as an argument as the script’s return code.

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

In addition to the original files, what else do we need before we can use the patch command?

A

Diff file

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

How we need to tell Git who we are?

A

git config –global user.email “xxx@gmail.com”

git config –global user.name “Svetlana”

17
Q

How to create folder and go into it?

A

mkdir newFolder
cd newFolder

(where newFolder - name of just new created folder)

18
Q

How to create new repository?

A

git init

Команда git init создает новый репозиторий Git.

При выполнении команды git init в текущем рабочем каталоге создается подкаталог .git со всеми необходимыми метаданными Git для нового репозитория. Метаданные включают подкаталоги для объектов, ссылок и файлов шаблонов. Кроме того, создается файл HEAD, который указывает на текущий извлеченный коммит.

19
Q

diff

A

diff is used to find differences between two files. On its own, it’s a bit hard to use;

20
Q

diff -u

A

diff -u is used to compare two files, line by line, and have the differing lines compared side-by-side in the same output.

21
Q

Patch

A

Patch is useful for applying file differences. See the below example, which compares two files. The comparison is saved as a .diff file, which is then patched to the original file!