From https://www.educative.io/ Flashcards
How do you know which git repo is the main source?
All git repos are the same.
There is no concept no a central server that hold the “golden” source.
Instead, we maintain our own source. A server or host may be in charge but fundamentally they are all the same.
What are the 4 phases a file tracked by git will go through?
This image is missing some arrows, what are they?
Make cards for overall workflow for:
installing
Connecting
backing up
pushing
pulling
starting new
etc
What does git status do?
Displays the state of the repo and staging area
Gives info on whether a file has been changed or staged
What does git log do?
gives a log of commits
can use –graph to see branching
use –all to see all branches
Add and commit changes in one message (only for already tracked files)
git commit -a
What happens if you do and do not use the -m with a commit?
With, looks for a message within quotation marks
without it opens nano and you can type the message there
See the specific changes (not just whether a file has changed)
git diff
Clone a repo from the harddrive
Clone a repo from github
git clone folderName targetfoldername (don’t git init first)
git clone https://github.com/ianmiell/shutit (don’t git init first)
What does git reset do?
What flag does it use by default
unstages files
–mixed
What does git reset –hard do?
Reverts files on your computer to the last commit
Revert files on your computer to the last commit
git reset –hard
unstage a single file
unstage all files
git reset filenameanddirectory
git reset –mixed
View log but only the title
git log –oneline
view branching log
git log –graph