Some Terminal and Git Commands Flashcards
“List” - shows files and directories contained in the current directory
ls
“Change Directory” - moves you into a new directory
cd
cd directory-name
cd .. (to move up a level)
“Make Directory”
mkdir
mkdir new-directory-name
Opening your default code editor (VSCode)
code .
Creating a file in a directory (i.e. index.html)
touch
Initialize Repo
git init
Adding changes to a repo
git add -A
-A means we’re adding all changes
Committing your edits to the main branch
git commit -m “add a message about what you changed”
This is like saving your work before a boss fight! Commit when things are going well!!
Checking to see if the commit worked
git status
Moving commits to GitHub
git remote add origin link
Send work to the remote repo
git push origin main(or master)
Making a copy of a remote repo to a local repo
git clone
Getting most recent changes from remote repo
git pull
Putting your local changes to the side before pulling remote repo
git stash
Adding local changes back to a project after stashing
git pop