Here's our suggestion for a reliable git workflow that works well in small team settings using Easydata.
If you haven't yet done so, please follow the instrucitons in our Git Configuration Guide first.
We suggest you start each day by doing this:
Sometimes, you stop work without checking things back in to the repo. Now, before you do any additional work, is the time to fix that.
git branch # what branch am I on?
git status # are there any files that need checking in?
git add -p # accept or reject parts of the modified files
git commit -m "put your commit message here"Did you make changes to your personal fork, but on a different machine? Make sure your local branch is up-to-date with your personal fork (origin):
git checkout main
git fetch origin --prune
git merge origin/mainDid someone make changes to the upstream repo in your absense?
Let's fetch and merge those changes
git checkout main
git fetch upstream --prune
git merge upstream/main
git push origin main
make update_environmentNow that your main branch is up-to-date with both origin and upstream, you should use it to update your local working branches. If you are already developing in a branch called, e.g. my_branch, do this before writing any more code:
git checkout my_branch
git merge main
git push origin my_branchWith your local main, origin/main and upstream/main all in sync, we like to clean up any old branches that are fully merged (and hence, can be deleted without data loss.)
git branch --merged main
git branch -d <name_of_merged_branch>A really great feature of git branch -d is that it will refuse to remove a branch that hasn't been fully merged into another. Thus it's safe to use without any fear of data loss.
Once you've finished all your merge tasks, you can create a clean working branch from the latest main by doing a:
git checkout main
git checkout -b new_branch_nameThat's it!. Do you have any suggestions for improvements to this workflow? Drop us a line or file an issue at cookiecutter-easydata.