Git 101 - The Basic Workflow

Reference

This post is being added retrospectively in order to consolidate all of my learning info in one searchable place. Comments are new (May 2022) but the code is old…use at your own risk!

These are the notes I made when I first learned how to work with git and GitHub.

This is not the only way and it might not be the best way but it is the way I’ve been working with Git:

Type the following on the command line:

git status 
git add -A (while on your branch)
git commit -m (while on branch) "enter informative commit message" <BUT DO NOT PUSH YET!>
git checkout master
git pull origin master
git checkout <your branch>
git merge master
<resolve conflicts manually>
git push origin <your branch>

(Then, go on Github and generate a pull request)

(And always triple check you’re on your branch to start with!)