Kostas Diakogiannis
Test por , creado hace más de 1 año

A 16 Questions basic self-assessment test regarding git and github workflow. Thus the participants can estimate how good they have proceeded with git, how further they need to go. Also for the teacher is a good tool for solving the commonest misconceptions on the spot.

180
0
0
Kostas Diakogiannis
Creado por Kostas Diakogiannis hace más de 6 años
Cerrar

Git self assesment Quiz

Pregunta 1 de 16

1

How can someone convert a normal folder with name my_project into a local git repository?

Selecciona una de las siguientes respuestas posibles:

  • Git merge my_project

  • Git remote add origin my_project

  • Git init

  • Git push origin my_project

Explicación

Pregunta 2 de 16

1

When someone clones a remote repository to his computer, this automatically gives him the access to change the code to the files in his computer and to push his code back to remote again.

Selecciona uno de los siguientes:

  • VERDADERO
  • FALSO

Explicación

Pregunta 3 de 16

1

What is the ultimate prerequisite for someone in order to perform a commit?

Selecciona una de las siguientes respuestas posibles:

  • Having the file changes stashed.

  • Having just changed some files.

  • Having the changed file also staged.

Explicación

Pregunta 4 de 16

1

Select the correct order of the actions , that have to be made if someone wants to send his code to remote from the beginning.

Selecciona una de las siguientes respuestas posibles:

  • 1. Make some file changes
    2. Commit them
    3. Stage them
    4. Push

  • 1. Make file changes
    2. Stage them
    3. Commit them
    4. Pull

  • 1. Make file changes
    2. Stage them
    3. Commit them
    4. Push

Explicación

Pregunta 5 de 16

1

You created a branch from master and you have been working on it tirelessly. You have already made some changes but you havn't staged them.

Suddenly a colleague of yours says to you that he has updated the master branch on remote and you must downloaded the latest changes.

How are you going to save your file changes on your current branch without performing a commit, in order to fetch the new code from master?

Selecciona una de las siguientes respuestas posibles:

  • Git add --all

  • Git commit -m 'some changes'

  • Git push origin branch

  • Git stash

Explicación

Pregunta 6 de 16

1

You have made a commit with some awesome changes and you pushed to remote. Unfortunately you have forgotten to add one small change to your previous commit. What should you do?

Selecciona una de las siguientes respuestas posibles:

  • After the changes, make a new commit, then push.

  • Fill the previous commit and add new changes there by typing *Git commit --amend*

Explicación

Pregunta 7 de 16

1

A colleague of your has updated the master branch while you were working on your branch locally. You have already brought these changes to your local master and you want to have them to your local branch as well regardless of commit order.

What seems correct? Your branch's name is jake.

Selecciona una de las siguientes respuestas posibles:

  • 1. Git checkout master
    2. Git merge jake

  • 1. Git checkout jake
    2. Git merge master

  • 1. Git checkout master
    2. Git rebase jake

  • 1. Git checkout jake
    2. Git rebase master

Explicación

Pregunta 8 de 16

1

When someone creates a local branch, that means that a corresponding branch is being automatically created on remote.

Selecciona uno de los siguientes:

  • VERDADERO
  • FALSO

Explicación

Pregunta 9 de 16

1

You have been working on your local branch and now you are ready to introduce these commits to your local master. What is the appropriate command given that you are standing on master now and given the name of your branch is jake.

Selecciona una de las siguientes respuestas posibles:

  • Git push jake

  • Git push origin master

  • Git merge origin master

  • Git merge jake

Explicación

Pregunta 10 de 16

1

What is the appropriate action to get out of the merge process right after you have solved merge conflicts in text editor?

Selecciona una de las siguientes respuestas posibles:

  • 1. Git add --all
    2. Git commit -m 'some message about the merge'

  • 1. Git commit -m 'some message about the merge'

  • 1. Git stash
    2. Git commit -m 'some message about the merge'

  • Git push --force

Explicación

Pregunta 11 de 16

1

What is the difference between merge and rebase?

Selecciona una de las siguientes respuestas posibles:

  • Rebase is a better option because you can pick a specific commit from another branch or from past and put it on top of your branch.

  • Rebase brings all commits from master branch and puts them on top of your branch's commits.

  • Rebase brings all commits from the specified branch but keeps the commits of your branch on top of them.

  • Rebase brings all the commits from the remote master but keep yours on top.

Explicación

Pregunta 12 de 16

1

How do you discard changes that you accidentally made in a file that is currently unstaged? The file is example.scss
The commit that you are currently is eb4c29u.

Selecciona una de las siguientes respuestas posibles:

  • Git reset HEAD example.scss

  • Git revert HEAD

  • Git checkout eb4c29u

  • Git checkout -- example.scss

  • Git checkout example.scss

Explicación

Pregunta 13 de 16

1

How to unstage a file that i have accidentally staged?

Selecciona una de las siguientes respuestas posibles:

  • Git checkout example.scss

  • Git reset --hard example.scss

  • Git reset HEAD example.scss

  • Git checkout HEAD

Explicación

Pregunta 14 de 16

1

How can someone discard the last commit and return to previous one without deleting anything?
The commit hash is eb49uf2

Selecciona una de las siguientes respuestas posibles:

  • Git reset --hard eb49uf2

  • Git checkout eb49uf2

  • Git revert HEAD

  • Git cherry-pick eb49uf2

Explicación

Pregunta 15 de 16

1

What is the appropriate action if someone wants to go back to the commit with hash eb49uf2 safely without deleting all the in-between commits?

Selecciona una de las siguientes respuestas posibles:

  • Git checkout eb49uf2

  • Git revert eb49uf2

  • Git merge eb49uf2

  • Git reset --hard eb49uf2

Explicación

Pregunta 16 de 16

1

16. What does *Git cherry-pick* command do?

Selecciona una de las siguientes respuestas posibles:

  • To fetch all the code from a specific branch to your branch by putting the other branche's commits on top of your own.

  • To fetch all the code from a specific branch to your branch by putting your branche's commits on top of the others.

  • To bring a specific commit from different branch. This commit will go on top of your commits.

  • To bring a specific commit from different branch. This commit comes, but your branche's commits remain on top.

Explicación