- This defines the folder as a git repository, and creates `.git`, a folder that contains metadata about the repo, like where the *remote* (repository hosted somewhere else) is, and other useful stuff like version control. You should not need to directly interact with this folder.
`git add .`
- This makes all files and folders in the current repository(can also be more precise by replacing `.` with specific files) tracked.
- Telling git that the files should come from and go to that remote repository, where `https://urltorepo.com/path/to/repo` is the destination repo.
- If the url is wrong, it can be removed with `git remote remove origin`
`git branch -M main`
- Syntax breakdown:
-`-M`, shortcut for `--move --force`, used to move/rename a branch.
- Telling git that we want the current branch to be `main`.
`git push -u origin main`
- Synatx breakdown:
-`-u` is a shortcut for `--set-upstream`
- Telling git that we want the main host of the repository(`origin`, or `https://urltorepo.com/path/to/repo`) to be the host. After this is run one time, git remembers, and you can shorten it to `git push`, to take commits(saved changes) from your local code, and send them to remote(GitHub or other Git server).
### Update code on github/remote
`git commit -am "changes"`
- Tell git to keep track of all the changes you made
- Download a folder containing all of the code and versions to a project, where `https://remotehost.com/repo/to/clone` is the url of the repo in question.