Getting Started with Git2 Flashcards
What are 3 possible stages of a file?
- Committed
- Modified
- Staged
What does it mean that a file is in “Committed” stage?
Data in this file is stored in local DB in the project.
What does it mean that file is “Modified” stage?
It means that the file has been changed since the last time it was committed in the local db.
What does it mean that he file is in Staged state?
Changes are marked to be committed.
3 main parts of Git project?
- .git directory (Repository)
- working directory (checkout of 1 version of a project)
- Staging area (Index) - used to build a commit
How to list all settings in Git config?
git config –list
How to show username from git config?
git config user.name
how to get help for “config” command in git?
git help config
How to add existing repo to remote origin?
git remote add origin __link__
How to push initial commit to origin?
git push -u origin master
How to authenticate using SSH?
Generate ssh key-pair using “ssh-keygen”.
Copy id_rsa.pub to ssh settings page in github.
What happens when you modify and stage a file, and then change it afterwards and call git status?
It appears in both modified/new file state and in untracked, since what you staged is a snapshot in time of a file.
What are the 3 columns of git status -s output?
- Status in “staging” area
- Status in “working directory”
- file name
How to commit while skipping adding to staging state?
git commit -a -m “message”
How to see a list of commits?
git log