GIT Flashcards Preview

Coding > GIT > Flashcards

Flashcards in GIT Deck (46):
1

What is a KEY skill in learning how to code?

Knowing how to manage the changes I make

2

What is a benefit of Git?

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

3

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

1. Create things
2. Save things
3. Edit things
4. Save the thing again

4

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

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

5

What is Version Control?

It is a History Tracking program

6

When is Version Control truly the most beneficial?

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

7

What does the tool "merge" allow me to do?

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

8

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

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

9

Git is a distributed _____ _____ system.

Version Control

10

Command for initializing a empty Git repository?

git init

11

What is a Git Repository?

A hidden directory where Git operates

12

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

git status

13

What does "untracked" signal in Git?

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

14

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

"git add filename.txt" command

15

Are files located in Git's "Staging Area" in the "Repository" yet?

No

16

How does one store the "Staged" changes in the "Repository?"

Run the "commit" command

Ex:
git commit -m "Add cute octocat story"

17

What can I use when I want to add many files of the same type to Git's "Repository?"

Wildcards (*)

Example:
git add '*.txt'

18

What is the command to commit to all changes made?

git command -m 'Add all the txt files'

19

What is 'git log' command?

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

20

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

Add a remote "Repository" folder on GitHub's website

21

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

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

22

What does the "push command" tell Git?

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

23

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

The name of the Git "remote"

24

What is the default local branch name on Git remote?

Master

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"