Git Basics Flashcards
what command displays the installed git version?
git –version
what is > ?
echo ‘# README #’ > README.md
redirection operator
It takes the output of the command and places it in the file whose name appears to the right.
what command creates a repository?
and what does it do?
git init
it creates a .git directory was added to the git_basics directory,
Note: only issue the git init command from within the directory that you wish to turn into a git repository.
how do you make a directory NOT a git repository?
delete the .git directory within that directory.
what is the .git Directory?
This directory will contain all of the configuration and metadata necessary for git to keep track of our files and the changes that we make to them.
What are the 3 places on your system where git keeps its configuration information?
/etc/gitconfig
Contains settings that are system-wide and apply to all users and all of their repositories.
~/.gitconfig
Configuration that is specific to your user account. This file overrides /etc/gitconfig.
/.git/config
Configuration that is specific to a repository. This file overrides both of the other files.
How do you configure your identity for git (AKA store your identity information, like name and email, in the ~/.gitconfig file)?
git config –global user.name “Maya Angelou”
git config –global user.email MayaAngelou@poets.com
what does the –global flag do for a git command?
tells git to save the configuration in the user-wide configuration file, ~/.gitconfig
what does the –system flag do for a git command?
tells git to save the configuration in /etc/gitconfig
thereby applying to all users on this computer
what happens if you do not pass the git config command any flags?
it will save the name and email in the current repo’s config file, git_basics/.git/config
what is the .gitignore file for?
a list of files and/or directories that you do not want included in your repository.
What is a git commit?
a way to logically group a bundle of various changes together.
A commit can contain changes across many files, it can contain the addition of new files, as well as the deletion of existing files.
In git, what is forked and merged?
only commits, not staged files, are forked and merged.
In git, we only move commits around.
what command lists all the remote repositories that your local repository knows about
git remote
what is origin in git?
alias to the remote repo