Git best practices

Hi,

just starting part 1 v3 and wondering if the community has settled on best practices for using git both for keeping up to date with Jeremy and Co’s master branch while also hacking away and version-controlling on personal versions of the notebook. It seems like @willismar and @jeremy together suggest something along these lines:

1 create private branch off of master for one’s own tinkering with course notebooks

git checkout -b <mybranch>

2 rename course notebooks for local tinkering under version control, prefixing “tmp” if you don’t care about version control

3 update master from the course repo and merge into private branch

git checkout master
git pull
git checkout <mybranch>
git merge master

Is this about right, or would you suggest improvements?

Thanks

6 Likes

For those who want to backup their work or browse the notebooks statically you can push your branch (see Nick’s post) to GitHub:

First create a private repository in GitHub. (Is it allowed to be public yet?)
Then:

$ git checkout MYBRANCH
$ git remote add MB https://github.com/USERID/MY_FASTAI_PROJECT
$ git remote -v
MB https://github.com/USERID/MY_FASTAI_PROJECT (fetch)
MB https://github.com/USERID/MY_FASTAI_PROJECT (push)
origin https://github.com/fastai/course-v3.git (fetch)
origin https://github.com/fastai/course-v3.git (push)
$ git push MB MYBRANCH

Where MYBRANCH is your branch name (see original post) and MB a shortcut name for your branch remote url.
In short: you pull from master but merge, commit and push from your branch.

2 Likes