- Repo #1: contains the central functions, subject to gitflow branching methodology or with a repo gatekeeper.
- Repo #2: separate trees of work. Each user has one branch that will be their
develop
, eg.develop-navid
,develop-otherperson
etc. Off those branches, each user creates their feature branches (twigs, eg.feature/navid-work-part-one
.) Squash feature branches to a single commit before merging back into their owndevelop-navid
or whoever, to keep commit histories clean. Into separate folders, clone that fastai by version (this will keep local copies by version in your own repo, making it much larger, but at least you can keep separate versions of the code for your old and new notebook things.)
Read about gitflow here: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
git fetch
git reset --hard origin/<myBranchName>
This is the safest way to avoid local-origin disparity. It will nuke your local code and always get freshest origin. Assume origin is good; it should be.
git rebase -i HEAD~<numberOfCommitsToSquash>
- Follow the key to
f
(squash and discard commit message) orr
(amend commit message) etc. so you can squash multiple commits in your twig, to merge one clean commit into your branch.
- If you want to grab someone else’s latest changes to a file,
git checkout feature/otherperson-branch -- filename.ext
orgit checkout develop-otherperson -- filename.ext
- If you want to grab an entire commit of someone else’s,
git cherry-pick <commitNumber>
git reset HEAD~
will un-commit, and you can make your changes, re-add
, and then commit
again
- Make a new twig
git checkout -b feature/navid-revert
git revert -m 1 <commitNumber>
which is the commitNumber of the merge- Make a PR (Peer Review) of this and merge it into your
develop
- Make a new twig
git checkout -b feature/navid-revert-the-revert
git revert -m 1 <commitNumber of the revert>
- Make necessary fixes, make a PR, and merge it into your
develop
The not-proper-way (don’t do this if you are sharing code please. Fine if you’re working on code that’s purely just you touching it)
git reset HEAD~
to un-commit- Make necessary fixes, commit and
git push --force