Getting Git Initially Setup
- Create a github.com account
- make sure git is installed
git --version
- configure github commiter info
git config --global user.name "Your Name"
git config --global user.email "name@email.com"
Git For Homework
Creating the Repo
- create an empty folder
mkdir <name>
- cd into that folder
cd <name>
- initialized the repo
git init
Committing your work
- add files to staging
git add .
- commit
git commit -m "message"
Push work to github.com
- Create a new repo github.com
- copy the url https/ssh for the repo
- add the remote repo to your local repo
git remote add origin <url>
- push up the commits
git push origin main or git push origin master
After remote is setup you just to send updates
git add .
git commit -m "message"
git push origin main
misc commands
- see the status of your repo
git status
- see what branch you are on
git branch
- see previous commits
git log
- see list of remotes
git remote -v
- remove the origin remote so you can readd it
git remote rm origin