Git and Github Flashcards
Git - Definition: What is a Repository?
A container (or folder) for a project tracked with git.
Git - Definition: What is a Commit?
checkpoints, or snapshots of the project at it’s current state - it’s a saved version of the code with a history, allowing us to go back and forth between revision
Git - Creating a Repository: Bash commands to navigate the directory (filepath, folder in current directory, previous directory, parent directory)
Access file path: cd c:/fullfilepath
Access folder in current directory: cd foldername
Access previous directory: cd -
Access parent directory: cd ..
Git - Creating a Repository: what does the bash command cd stand for?
Change Directory
Git - Creating A Repository: bash command making a directory
Within the designated directory -
mkdir [newfoldername]
Git - Creating A Repository: bash command making a new blank file
Within the designated directory -
touch [filename.filetype]
Git - Creating A Repository: bash command listing files in current directory
Within Designated directory -
ls
Git - Committing Files: What are the 3 stages to a commit?
- Modification - File changes
- Staging - Approving file changes
- Committing - Creating new version
Git - Committing Files: How do you check what files have been modified or staged since the last commit?
Use the bash command:
git status
Git - Committing Files: What is staging area?
An area that allows approved modified files to be committed, they must first be added to the staging area. This stops unwanted files from being committed.
Git - Committing Files: How do you stage files?
Bash Commands:
Automatically add modified files: git add .
Add specific files: git add [filename]
Git - Committing Files: How do you unstage files - retaining the modification?
Use the bash command:
git reset [filename]
Git - Definition: What is Git?
The software Git is a version control system (vcs) for tracking changes in computer files
Git - Committing Files: How do you commit staged files?
Bash Command:
git commit -m “comments on the changes made”
Git - Committing Files: How do you check the commit history?
Bash Command:
full version: git log
condensed version: git log -oneline