git Flashcards

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

git init

A

initializes a git repository

creates a .git directory, which if deleted will remove the git tracking

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

/etc/gitconfig
~/.gitconfig
REPOSITORY/.git/config

A

Git configuration files.
/etc/gitconfig = system wide, applicable to all users
~/.gitconfig = user specific
REPOSITORY/.git/config = repository specific

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

git config –global user.name “Maya Angelou”

A

Sets a user.name variable in gitconfig
git config –system sets variables in system gitconfig
git config without flags sets variables in the repository gitconfig

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

git status

A

displays the working tree and staging area.

Working tree = files that will be in next submit
staging area = files not impacted by a submit

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

.gitignore

A

tells git which files / directories to ignore
e.g. will do as comment indicates:
# Ignore all SQLite databases
db/*.sqlite3

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

git add

A

Add a file to git for tracking. Changes made after git add will not be included in a commit
Prior to adding, the file is untracked, and changes can still be made as part of current revision

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

git commit

A

a bundle or group of changes which are posted back to main branch.
Can contain multiple files, including new files, and deletion of existing files.
-m flag allows addition of message to the commit

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

git log

A

displays a history of commits

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

branch

A

copy of all the files in the codebase.
Each branch has an identifying name, and seter of version of commit history
A branch is made by forking
branch commits (not files!) can be merged back into main branch

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

git fetch

A

pulls all changes from github down to local git repository

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

git push

A

“push” a local git repository to github to track
use “git push -u origin main” to push setting the default upstream repository for push / pull, etc.
sets the “main” branch in the “origin” repository

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

git diff

A
used to compare remot to local repositories.  
use 
git diff main origin/main
or
git diff origin/main main
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

git pull

A

used to pull changes in local repository from remote

git pull –ff-only

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

git clone

A

makes exact copy of remote repository to new local repository

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