copy repo from GitHub
git clone <URL>
stage the file
git add.
check file status
git status
commit the file
git commit -m "msg" -m "more desc"
commit an existing file
git commit -am "msg"
make GitHub same as local
git push origin main
set the origin main as default
git push -u origin main
git push
make a local folder a repo
git init
link to a remote site
git remote add origin <URL>
show the remote site list
git remote -v
add a branch from main
@main git switch -c <name>
list branch
git branch
check the diff btw branch
git diff <branch name>
merge branch to main
@main git merge <branch name>
create a pull request
git pull
delete a branch
git branch -d <branch name>
keep local branch updated to main
git merge main
undo a add (the edits stay)
git reset
undo a commit step (the edits stay)
git reset HEAD~1
undo a certain commit (the edits stay)
git reset <hash>
undo a certain commit (get rid of edits)
git reset --hard <hash>