Git QuickTip: a Workflow for Git On Teams
This tutorial is pretty straightforward. It assumes you already have your project cloned from a master remote repository, and that your project already has an origin repository it is pointing to. As long as you have those things, do this daily. Keeping code "hoarded" tends to lead to more severe merge conflicts - so this should happen at least once a day for the project you are working on:
git commit -m "I'm doing awesome work" -a
If you don't want to commit everything you currently have working directory changes for:
git add (file name or directory to commit
git commit -m "Committing some of my work, but not all of it"
git stash (If you stash file changes here, you'll have to pull them back out of the stash in a few minutes)
git rebase origin/(branchname)
Resolve any merge conflicts that happen
git add .
git rebase --continue
git push origin branchname
Optional: If you stashed some changes before, here use
git stash apply to put them back into your working directory