GIT Flashcards

1
Q

What is a KEY skill in learning how to code?

A

Knowing how to manage the changes I make

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

What is a benefit of Git?

A

Makes controlling the different versions of my code easier for me and my team

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

What are 4 very high level tasks of what a coder does daily?

A
  1. Create things
  2. Save things
  3. Edit things
  4. Save the thing again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does version control help me as a coder that saves things again and again?

A

It helps me track

  1. When I saved a change
  2. Why I saved a change
  3. What the contents of the change was
  4. Who was the person that made the change
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Version Control?

A

It is a History Tracking program

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

When is Version Control truly the most beneficial?

A

When I am working on a collaboration on the same things and the same files

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

What does the tool “merge” allow me to do?

A

Allows 2 simultaneous changes from me and someone else to be merged into a unified and resolved, good and final state

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

What does Git’s Version Control bring to the table as benefits?

A
  1. Very lightweight and modern implementation of a version control
  2. Very fast
  3. Provides a history of content change
  4. Facilitates collaborative file changes
  5. Easy for any type of knowledge workers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Git is a distributed _____ _____ system.

A

Version Control

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

Command for initializing a empty Git repository?

A

git init

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

What is a Git Repository?

A

A hidden directory where Git operates

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

What is the command to see the current status of my Git project?

A

git status

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

What does “untracked” signal in Git?

A

That the “untracked” file is new to Git and needs to be added to the staging area so it can be tracked

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

How do I add a file to the Git “staging area?”

A

“git add filename.txt” command

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

Are files located in Git’s “Staging Area” in the “Repository” yet?

A

No

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

How does one store the “Staged” changes in the “Repository?”

A

Run the “commit” command

Ex:
git commit -m “Add cute octocat story”

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

What can I use when I want to add many files of the same type to Git’s “Repository?”

A

Wildcards (*)

Example:
git add ‘*.txt’

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

What is the command to commit to all changes made?

A

git command -m ‘Add all the txt files’

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

What is ‘git log’ command?

A

It is a journal command that remembers all of the changes I have committed to in the order they were committed to.

20
Q

How can I add a local “Repository” folder to the GitHub server?

A

Add a remote “Repository” folder on GitHub’s website

21
Q

What is and example of the command I would use to add a remote “Repository” folder to GitHub?

A

git remote add origin https://github.com/try-git/try_git.git

22
Q

What does the “push command” tell Git?

A

Where to place my local commit changes in the remote Git folder

23
Q

What does “origin” tell us in this command “git push -u origin master”

A

The name of the Git “remote”

24
Q

What is the default local branch name on Git remote?

25
What does the "-u" tell us in the command "git push -u origin master"
Tells Git to remember the parameters so that next time we can simply run "git push" and Git will know what to do
26
What is the command to "push" my local commits to remote Git?
git push -u origin master
27
How can I check for changes made in the GitHub repository and also pull down the changes made on my local repository?
Run the "git pull origin master" command
28
How can I look at what is different from my last "commit?"
Run command "git diff HEAD"
29
What does the "HEAD" portion of the command "git diff HEAD" tell my computer?
When I am asking for the differences of my most recent commit
30
What are "staged files?"
Files I have told Git that I am ready to be committed to
31
A great use for differences (diff) is looking at changes made within files that have already been _____.
Staged
32
What command would I use to "stage" (commit) files to a repository?
"git add" Example: "git add octofamily/octodog.txt"
33
What does the "git diff --staged" command tell the computer
To show me the changes that I have recently "staged" (committed to)
34
How can I tell the computer to "unstage" files?
Using the "git reset" command. Example: "git reset octofamily/octodog.txt"
35
Is a file deleted when it has been "unstaged?"
No, the file is still there it is just not staged
36
How can I change things back to how they were at the last "commit?"
Run the "git checkout -- " command. Example: "git checkout -- octocat.txt"
37
What does the term "branch" mean to a developer?
A copy
38
What is helpful for developers to do when working on a feature or a bug?
Create a "branch" or copy of their code so they can make separate "commits" to
39
How can I create a "branch?"
With command "git branch " Example "git branch clean_up"
40
How can I see what my local "branches" are?
With command "git branch"
41
How can I switch the "branch" I am working in?
Using the "git checkout " command Example: "git checkout clean_up"
42
What does the "git rm | ''" command tell my computer?
1. "Stage" the removal of files | 2. Remove actual files from the disk
43
How can I check the changes I am about to "commit" to?
Run "git status" command
44
What command do I use to commit to the changes I want to make?
"git commit -m "my label of the changes I am committing to" Example: "git commit -m "Remove all the cats"
45
What are the steps to copy (merge) changes made in the non-Master branch?
1. Switch to the "master" branch using "git checkout master" command 2. Merge the changes to the master branch with the "git merge " Example: "git merge clean_up" 3. Delete the non-master branch folder with command "git branch -d " Example: "git branch -d clean_up"
46
What is the command to "push" from my local repository to Git's remote repository?
"git push"