Basics Flashcards

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

git init [project_name}

A
  • initializes a new repository
  • if project_name is provided, it creates a new project directory with that name
  • if not, it initializes a repository in the current directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

cd

A
  • think ‘change directory:’ change the current working directory
  • remember that ~ is a special symbol that always represents your “home” directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ls

A
  • think ‘list:’ shows a list of all files/folders in the current directory
  • with the -a flag, also shows hidden files and folders
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

mkdir

A
  • think ‘make directory:’ creates a new directory with the specified name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

touch

A
  • updates the “last modified” timestamp on a file to now

- also creates an empty file if the filename specified doesn’t exist

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

mv

A
  • think ‘move:’ moves a file or directory to a new location

- this also makes it a convenient way to rename files and folders

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

rm

A
  • think ‘remove:’ deletes the file(s)/folder(s) specified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

git add

A
  • adds files to the repository so that Git knows to track their changes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

git commit

A
  • commits all added files to the repository as a change
  • with the -a flag, commits all changes to all tracked files
  • with the -m flag, allows you to specify a commit message directly on the command line instead of in your default editor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

git config

A
  • allows you to make configuration changes to Git

- with the –global flag, makes these changes available across your entire system

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

git status

A
  • show the current status of the git repository, including if there are any uncommitted changes and whether or not any of our changes have been put in the staging area
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

git log

A
  • shows a chronological log of all of our commits to the current repository
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

git checkout

A
  • “check out” a different version of the code from the one you’re currently looking at
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

git diff

A
  • create a “diff” view to demonstrate what has changed between two different versions of your repository
How well did you know this?
1
Not at all
2
3
4
5
Perfectly