Git in the command line

Description

Quick Github test based on content from CodeSchool Git Real
philyorkshire
Quiz by philyorkshire, updated more than 1 year ago
philyorkshire
Created by philyorkshire about 9 years ago
67
0

Resource summary

Question 1

Question
How do you see the differences of files ONLY for the staged files?
Answer
  • git diff
  • git diff --staged
  • git diff -s

Question 2

Question
How do you roll-back the last commit and keep all the changed files locally?
Answer
  • git reset --soft HEAD^
  • git reset --hard HEAD^
  • git reset --soft HEAD^ index.html

Question 3

Question
How do you create a new branch and switch to that branch in one statement?
Answer
  • git checkout -b "cats"
  • git -b checkout cats
  • git checkout -b cats

Question 4

Question
Running 'git push origin :cats will delete the remote branch called 'cats'?
Answer
  • True
  • False

Question 5

Question
How would you set up an alias for 'git status' to 'git s'?
Answer
  • git config --global alias.s status
  • git config --global alias 'git s' 'git status'
  • git config --global alias.s 'git status'
Show full summary Hide full summary

Similar

Git/Version Control
Andrew Watters
Origin master
Kostas Diakogiannis
GitHub issue workflow
Domhnall Murphy
Git - GitHub
Nguyet Huynh
Git y GitHub Difference
Ray T.H.
Estados de Git y de los Archivos
Ray T.H.
Spring Development Training 2017: week 5
Stefcho Stefchov
Resources
Wolter Liunda
OCR AS CHEMISTRY A DEFINITIONS
awesome.lois
Unit 1 flashcards
C R
Cloud Data Integration Specialist Certification
James McLean