Git vs Github - ANSWER Git is a Distributed Version Control System that
helps to track the changes in the source code. Git is simply a persistent hash
map wherein key is the hash of file and the value is the contents of the file.
Github is used to manage the remote repository. If you wanna use Git you
must install in your local machine.
cat command - ANSWER Allows us to create to create single or multiple files,
view contain of file, and concatenate files and redirect output in terminal or
files
nano - ANSWER edit the file using this shell command
what does git init do? - ANSWER creates the git repository and places the
hidden .git folder within the git repository
how to view hidden folders in finder - ANSWER command + shift + .
what are the four object types in git - ANSWER Blob, tree, commit, annotated
tag
what is blob - ANSWER It is an object type for git. Binary large object => Its
the object type used to store contents of each file in a repository (file data)
tree - ANSWER It's an object type for git. It stores information about
directories. In other words, it's just like a directory - it references bunch of
other trees and/or blobs, i.e. files and sub-directories
, commit - ANSWER Its an object type that allows to store different versions of
the project
annotated tag - ANSWER object type, which is a persistent pointer that
points to different commits
What does a hash function do? - ANSWER Generates a fixed length hash
based on the input. Same input will have the same hash. One way function.
Cannot get input based off hash. Only hash based off input
git hash-object - ANSWER allows us to create a new blob object type
sha1 bit size? - ANSWER 160 bits
how to create hash from string in command line ANSWER echo "Hello Git" |
shasum
what is the probability of reaching a specific hash given a file ANSWER
1/(2^160) => There are 2^160 possible options for SHA1 (160 bits)
git cat-file options ANSWER - git cat-file -p <hash> => contents of the
object
- git cat file -s <hash> => size of the object
- git cat file -t <hash> =>type of the object
how to git the hash of the a file or object using pipe - ANSWER echo "Hello,
Git" | git hash-object --stdin -w
--stdin => take input from standard input
- w => create git object
how would you write a string to a new file - ANSWER echo "Hello Git" >
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Smooth. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.99. You're not tied to anything after your purchase.