Basics of GitHub Flashcards
Week 1 (10 cards)
1
Q
cd
A
change directory
2
Q
pwd
A
tells you where you currently are
3
Q
touch
A
makes a new file
4
Q
mkdir
A
makes a new directory
5
Q
rm
A
removes a file
6
Q
rf
A
removes a directory
7
Q
steps to saving code
A
- git add -A
- git commit -m “…”
- git push
8
Q
creating a branch (from main) steps
A
- git branch - list branches
- git branch “my_name” - creates a new branch with name “my_name”
- git branch -d “my_name” - delete the branch with name “my_name”
9
Q
working in that branch commands
A
- git checkout “my_name” - move to the named branch
- git commit - your commit commands now work in that branch
- git push - you must ‘push’ your work before attempting to merge
10
Q
merging your branch to main (must be in main) steps
A
- git checkout - more to main branch
- git pull - update the main branch
- git merge ‘my_name’ - merge named branch into the main code
- git branch -d “my_name”