Intro to Version Control Flashcards
What is Version Control?
A system that records changes to a file or set of files over time so that you can recall specific versions later.
What does “git init” in the terminal do?
Creates a .git file that tracks all your changes, commit your changes, and perform version control.
What is a “Staging Area” in the terminal?
An intermediate place where you can pick and choose which files inside your working directory that you want to commit.
How do you check what’s in your terminal’s staging area?
“git status” command. It shows you untracked files which are shown in red.
How do you start tracking untracked files in the terminal?
“git add” command + file name.
How do you record changes to the repository?
“git commit” command
How do you add a message with your git commit?
-m “_____” command
What is a software repository?
aka “repo”. A storage location from which software packages may be retrieved and installed on a computer.
What is the command to check what git commits you’ve made?
“git log” command
What is the command to add any untracked files in a folder to the staging area where they can be tracked?
“git add .”
What is the “Working Directory”?
The folder or the directory where you initialize your git repository.
What is the “Staging Area”?
A place to try and figure out what are the files you want to ignore or get tracked.
What command do we use to push a file from the working directory to the staging area(terminal)?
“git add”
What are the three stages in the terminal to commit a file?
Step 1: Create in Working Directory
Step 2: Push it to the Staging Area to track or ignore.
Step 3: Commit it into the Local Repository
What is the terminal command to revert back to the last repository?
“git checkout” command
What is the terminal command to check the difference between the changes of the same file?
“git diff” command
What is the difference between making local repositories and remote repositories?
Local repositories is controlling and saving file versions locally on your computer whereas remote repositories is hosting your files and version controls on somebody else’s server or computer.
How do you push your local repository to a remote repository?
“git remote add origin locationlink/file” command
How do you push your local repository to a remote repository?
“git remote add origin(this can be named whatever you like) locationlink/file” command