Git and GitHub Flashcards

1
Q

Search query in GitHub

A

dotnet stars:> 1000

searches for the word dotnet where the project received more than 1000 stars

dotnet NOT “hello world”

word dotnet and not contain “hello world”

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

Download recent changes to the repo OR add the missing branches

A

git fetch

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

Download recent changes to the repo AND merge the changes

A

git pull

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

File that will make sure that the changes are reviewed before they are implemented

A

CODEOWNERS

Inside the file do:
@kristina-abrahamyan

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

Collaborator vs Contributor

A

Collaborator can edit the code.

Contributor can only create requests that will need to be reviewed before the code is allowed to be edited.

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

Create a new branch

A

git branch [branch-name]

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

To switch to a local branch

A

git checkout -b [branch-name]

if the branch already exists, we are simply switching to it, if not, git creates this new branch

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

Pushing to the GitHub the newly created branch.
The new branch created through Git is only stored locally until it’s pushed to GitHub through this way.

A

git push -u origin [branch-name-chosen-locally]

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

When a merging issue arises

A
  1. git push
  2. git pull
  3. code changed_file.py
  4. delete the version we don’t like + save the file and close it in the editor
  5. git commit -am “resolved merge conflict”
  6. git push
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

File name to put that info in the description part of the Pull Request (PR), i.e. the template for the PR

A

pull_request_template.md

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

Forks in GitHub

A

Copy of the existing repo.

Forking is available to anyone.
Forks are not available in Git.

Fork creates your own personal repository, so when you make changes and push them, they are pushed to this forked repo.

When you think that the changes are worth being mentioned in the upstream/original repository, you can create a PR (pull request).

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

Looking through the history of commits using Git

A

git log

To exit, use –> q

git log –oneline –graph –decorate –all

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

To see the tags associated with commits

A

git tag

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

Create a tag that points to repo main

A

git tag stable main

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

Create an annotated tag pointing to a specific commit done before

A

git tag -a v0.1 -m “0.1 Release” 0eff960

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

Push the new tags to the GitHub

A

git push –tags

17
Q
A
18
Q

GitHub Action

A

When an event occurs it triggers a workflow.
Workflow contains several jobs.
Runner wraps in itself the workflow and it is a server that runs the automation code.
The smallest unit is action - it is created using YAML.