GitHub and Git Flashcards

1
Q

You should complete a GitHub workflow, which should:
* scan for pull requests on main branch when they come from a prefix like ‘CR/’
* scan all subdirectories of the src directory
* exclude markdown (.md) file in any subdirectory

The following workflow:
~~~
on:
pull_request:
branches:
- main
___
paths:
___
paths-ignore:
___
~~~
You can use the following terms one or multiple times:
* **/*.md
* *.md
* CR/*
* CR/**
* src/*
* src/**

A
on: 
                    pull_request:
                       branches:
                     - main
                         - CR/**
                       paths:
                          - src/**
                        paths-ignore:
												- **/*.md
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

You have a project named Project1. Your project depends on a library whose repo could be found at https://github.com/MyOrganization/DependentLibrary
You need a clone of this repo as subdirectory of Project1 repository. Which command should you use??

git \_\_\_ \_\_\_\_ https://github.com/MyOrganization/DependentLibrary

Choose the terms here (one or multiple times):
* add
* branch
* clone
* pull
* submodule

A
git submodule add https://github.com/MyOrganization/DependentLibrary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You have a git repo that should be cleaned. You have to remove all items referenced only in reflog.

Complete the following command
git \_\_\_ expire --expire-unreachable=now --all
Choose the term:
* gc
* reflog
* reset
* stash

A

git reflog expire --expire-unreachable=now --all

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

You have a git repo that should be cleaned. You have to remove history that is not part of any current branch

Complete the following command
git \_\_\_ --prune=\_\_\_
Choose the terms (one or multiple times):
* gc
* init
* reflog
* reset
* all
* now
* true

A

git gc --prune=now

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

In Git what command can be used to undo the unstaged changes made on a file and return to the version of the last commit?

A

git restore <filenameHere>

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

If we have some staged changes which command should be launched before going to restore them?

A

You should first reset the changes, then you can proceed with git restore:
git reset <fileName1> <fileName2> ...
git restore <fileName1> <fileName2> ...

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

Which are the default processes for organizing the Azure Boards?

A

We have four default processes:
1. Basic
2. Scrum
3. Agile
4. CMMI

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