Git Basics Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what command displays the installed git version?

A

git –version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is > ?

echo ‘# README #’ > README.md

A

redirection operator

It takes the output of the command and places it in the file whose name appears to the right.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what command creates a repository?

and what does it do?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how do you make a directory NOT a git repository?

A

delete the .git directory within that directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the .git Directory?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 3 places on your system where git keeps its configuration information?

A

/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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you configure your identity for git (AKA store your identity information, like name and email, in the ~/.gitconfig file)?

A

git config –global user.name “Maya Angelou”

git config –global user.email MayaAngelou@poets.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what does the –global flag do for a git command?

A

tells git to save the configuration in the user-wide configuration file, ~/.gitconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what does the –system flag do for a git command?

A

tells git to save the configuration in /etc/gitconfig

thereby applying to all users on this computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what happens if you do not pass the git config command any flags?

A

it will save the name and email in the current repo’s config file, git_basics/.git/config

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the .gitignore file for?

A

a list of files and/or directories that you do not want included in your repository.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a git commit?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In git, what is forked and merged?

A

only commits, not staged files, are forked and merged.

In git, we only move commits around.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what command lists all the remote repositories that your local repository knows about

A

git remote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is origin in git?

A

alias to the remote repo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what does the fetch command do?

A

download the commit data for each branch that the remote repo contains

17
Q

what are the 2 different ways of authenticating with Github from the command line? And what credentials do they use?

A
  1. HTTPS
    authenticate using username and password and Password Caching

required cloning git repo with HTTPS

  1. SSH
    authenticate using SSH keys