Basics 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
2
Q
cd
A
- think ‘change directory:’ change the current working directory
- remember that ~ is a special symbol that always represents your “home” directory
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
4
Q
mkdir
A
- think ‘make directory:’ creates a new directory with the specified name
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
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
7
Q
rm
A
- think ‘remove:’ deletes the file(s)/folder(s) specified
8
Q
git add
A
- adds files to the repository so that Git knows to track their changes
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
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
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
12
Q
git log
A
- shows a chronological log of all of our commits to the current repository
13
Q
git checkout
A
- “check out” a different version of the code from the one you’re currently looking at
14
Q
git diff
A
- create a “diff” view to demonstrate what has changed between two different versions of your repository