Git in the command line

philyorkshire
Quiz by philyorkshire, updated more than 1 year ago
philyorkshire
Created by philyorkshire about 6 years ago
42
0

Description

Quick Github test based on content from CodeSchool Git Real

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
Git y GitHub Difference
Ray T.H.
GitHub issue workflow
Domhnall Murphy
Estados de Git y de los Archivos
Ray T.H.
Git - GitHub
Nguyet Huynh
Spring Development Training 2017: week 5
Stefcho Stefchov
Resources
Wolter Liunda
HRCI Glossary of Terms A-N
Sandra Reed
How Parliament Makes Laws
harryloftus505
Teaching Using GoConqr's Tools
Micheal Heffernan